Sudo Sh Cd App_directory Npm Install In Mac

2021. 3. 10. 12:23카테고리 없음

A lot of Linux and macOS newcomers to NodeJs got a problem with NPM installer: Either run npm install -g <package_name> under sudo privilege or install the package locally to the project (under node_modules folder) and call it via full path or npx. Fortunately, there’s a simple workaround that takes you less than a minute to solve the puzzle.

Just open your Terminal and make sure the location is your $HOME directory. If it isn’t, you’ll need to use the so familiar “cd” to change the directory to your $HOME folder. Then copy and paste this simple line to the current open Terminal and hit Enter or Return to start:

Sudo

Npm run build Builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance. user@server $ ll total 4 -rwx- 1 user user 2608 Jul 15 18:23 qa.sh However, when I attempt to run it with sudo it says it can't find it: user@server $ sudo./qa.sh sudo password for user: sudo: unable to execute./qa.sh: No such file or directory This is on a fresh build. No changes have been made which would cause problems.