If everything went well, you should see a 'Happy Hacking' message as the last line.
Npm config set prefix install#
Step 10: Type 'Y' to install create-react-app package We can use the following: mkdir /.npm-global. Then from the command line, in the home directory, we need to create a directory for global installations. Step 8: Set prefix properly this time -> npm config set prefix /usr/local In this example, we will create and use the hidden directory in the home directory. Use npm config list (or npm config ls) to see what is available: npm config list cli configs user-agent 'npm/2.12.1 node/v0.12.7 darwin 圆4. While some are located in /.npmrc not all are. npm has a number of configuration values you can set. Step 5: Clear npm cache again -> npm cache clean -force Snippet Posted by kitt at 13:10 on 13 August 2015. Step 4: Install latest npm -> npm install -g -force Step 3: Clear npm cache by force -> npm cache clean -force
Npm config set prefix password#
Step 2: Enter your root credential password
![npm config set prefix npm config set prefix](https://s3.amazonaws.com/s3bucket01.elvenware.com/dev-images/cloud/Midterm01.png)
Step 1 : On your terminal get into root account by typing -> sudo -I Anyway, here are the steps I took to resolve the issue. Now, when I try and run - % npx create-react-app myAppĮrror: EPERM: operation not permitted, mkdir '/usr/loca'īecause there is no directory by name 'loca'.įew suggestions about disabling SIP to make it work are there but I think it's not a good idea. The problem is with: % npm config set prefix /usr/locaĪs you can notice from the above, I forgot the letter 'l' at the end of the line leading to npm config setting my 'prefix' to /usr/loca Thought it might help people who are facing a similar issue. Took me about 2 hours to figure this out. TypeError: Cannot read property 'loaded' of undefinedĪt exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97:27)Īt process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)Īt process._fatalException (internal/process/execution.js:150:25) usr/local/lib/node_modules/npm/lib/utils/error-handler.js:97 TypeError: Cannot read property 'get' of undefinedĪt errorMessage (/usr/local/lib/node_modules/npm/lib/utils/error-message.js:38:39)Īt errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:201:13)Īt /usr/local/lib/node_modules/npm/bin/npm-cli.js:78:20Īt cb (/usr/local/lib/node_modules/npm/lib/npm.js:225:22)Īt /usr/local/lib/node_modules/npm/lib/npm.js:263:24Īt /usr/local/lib/node_modules/npm/lib/config/core.js:81:7Īt /usr/local/lib/node_modules/npm/lib/config/core.js:80:13Īt f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)Īt afterExtras (/usr/local/lib/node_modules/npm/lib/config/core.js:171:20) Now if I try to run any npm command it will just throw errors: Error: EPERM: operation not permitted, mkdir '/usr/loca'
![npm config set prefix npm config set prefix](https://img-blog.csdnimg.cn/20210512190418320.png)
![npm config set prefix npm config set prefix](https://img2018.cnblogs.com/common/1300009/201912/1300009-20191220170912617-1245997498.jpg)
I found posts suggesting to try: npm config set prefix /usr/local.īut I typed " npm config set prefix /usr/loca" on accident. I was trouble shooting the " ionic: command not found" issue.