这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@thisistonydang
Copy link
Contributor

Summary

Explicitly set the folder for npm install in using the --prefix flag to prevent installation into the wrong folder.

Reason for change

In the current install_npm_deps script, we cd into the assets folder then perform the installation. This won't always work because if a package.json does not already exist in the assets folder, npm will look for the nearest parent folder containing either a package.json file or a node_modules folder and do the installation there.

Using the --prefix flag will force installation in the specified folder.

@woutdp
Copy link
Owner

woutdp commented Nov 24, 2023

Nice, thank you!

@woutdp woutdp merged commit c099c22 into woutdp:master Nov 24, 2023
@thisistonydang thisistonydang deleted the tonydangblog/explicitly-set-npm-folder branch November 24, 2023 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants