NativeScript / NativeScript/nativescript-cli

NPM not working under any circumstances

Ouverte
#5,340 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
JavaScript
Étoiles
1.1k
Forks
204
Merge moyen
1 j 9 h
PR mergées (30 j)
8

Description

Hello,

I am trying to run NPM on my Mac but it is having the same issue. I have followed all the steps to try and fix this, but when I install after un-insttalling, I get npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

And I cannot run the npm to local host. When I try using npm run, I get this;

npm run
Lifecycle scripts included in react-redux-router:
preinstall
npm set audit false
start
webpack-dev-server --config webpack/dev.config.js --watch

available via npm run-script:
build
cross-env NODE_ENV=production webpack --config webpack/prod.config.js --progress --display-error-details --color
heroku-postbuild
npm run build
precommit
eslint src
prod
NODE_ENV=production node server.js

I tried to run delete node_modules but it said I did not recognize the command. Both NPM and Node are updated to their lastest updated versions, npm at 6.14.5 and node at v14.5.0. My mac is running Catalina 10.15.5. Any idea why this is happening or how I can fix it?
Describe the bug

To Reproduce

I just go into my npm and try to start it or run it and I get the output above.
Expected behavior
for it to run my project on localhost:3000 so I can see my work
Sample project

Additional context
Please let me know if you have any questions.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Le rapport mentionne npm 6.14.5, Node v14.5.0, macOS Catalina et un projet React utilisant webpack/dev.config.js. Commencez par reproduire l’erreur EACCES de /usr/local/lib/node_modules et l’échec de npm run, puis déterminez si le problème relève de NativeScript CLI ou des permissions npm locales. Le travail est terminé lorsqu’une reproduction propre au projet est confirmée et qu’un chemin de démarrage localhost est vérifié.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, node.js
Domaine
cli
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
15/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.