Erreur NPM

Par leocoinsin, il y a 9 ans


Javascript NodeJS

Bonjour, je travaille sur mac.
Pour remettre les choses dans son contexte j'ai acheté un magazine et dedans il propose la création d'un bot avec slack mongodb et un superscript. Tout fonctionne a merveille sauf le moment ou je souhaite installer le superscript. Je rentre la commande indiqué sur le livre c'est a dire le "npm install superscript -g". Mais voila je rencontre un problème.

MBP-de-Leo:~ leocoinsin1$ npm install superscript -g npm WARN deprecated WNdb@3.1.1: WNdb has been superceded by wordnet-db. Please update your dependency. npm WARN deprecated mongodb@2.2.16: Please upgrade to 2.2.19 or higher npm WARN deprecated mongodb@1.4.38: Please upgrade to 2.2.19 or higher npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules /usr/local/lib [...] npm ERR! Darwin 16.0.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "superscript" "-g" npm ERR! node v6.9.2 npm ERR! npm v3.10.9 npm ERR! path /usr/local/lib/node_modules npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules' npm ERR! at Error (native) npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules' npm ERR! at Error (native) npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path: '/usr/local/lib/node_modules' } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! Please include the following file with any support request: npm ERR! /Users/leocoinsin1/npm-debug.log

Or je souhaite avancer mais je ne peux pas. Merci de bien vouloir m'aider si ca ne vous dérange pas.

5 réponses

betaWeb, il y a 9 ans

Salut,

Tout est dans l'erreur : tu n'as pas les droits en lecture sur le dossier '/usr/local/lib/node_modules'. Il faut être admin de ta machine pour pouvoir installer tes dépendances.

Kenor, il y a 9 ans

Donc il te faut utiliser sudo :
sudo npm install superscript -g

si toutefois tu ne savais pas :)

betaWeb, il y a 9 ans

sudo fonctionne également sous OSx ?

Kenor, il y a 9 ans

Oui oui (je suis sur un MBP aussi ;))

leocoinsin, il y a 9 ans

Merci de toute vos réponses mais lorsque je le fais avec ' sudo npm install superscript -g ' ca me fais ca:

npm WARN deprecated WNdb@3.1.1: WNdb has been superceded by wordnet-db. Please update your dependency. npm WARN deprecated mongodb@2.2.16: Please upgrade to 2.2.19 or higher npm WARN deprecated mongodb@1.4.38: Please upgrade to 2.2.19 or higher /usr/local/bin/parse -> /usr/local/lib/node_modules/superscript/bin/parse.js /usr/local/bin/bot-init -> /usr/local/lib/node_modules/superscript/bin/bot-init.js /usr/local/bin/bot-cleanup -> /usr/local/lib/node_modules/superscript/bin/cleanup.js > kerberos@0.0.11 install /usr/local/lib/node_modules/superscript/node_modules/kerberos > (node-gyp rebuild 2> builderror.log) || (exit 0) > bson@0.2.22 install /usr/local/lib/node_modules/superscript/node_modules/mongoose-path-tree/node_modules/bson > (node-gyp rebuild 2> builderror.log) || (exit 0) > re2@1.4.1 install /usr/local/lib/node_modules/superscript/node_modules/re2 > node-gyp rebuild /usr/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp: line 3: node: command not found /usr/local/lib └── (empty) npm ERR! Darwin 16.0.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "superscript" "-g" npm ERR! node v6.9.2 npm ERR! npm v3.10.9 npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! re2@1.4.1 install: `node-gyp rebuild` npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the re2@1.4.1 install script 'node-gyp rebuild'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the re2 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs re2 npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls re2 npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /Users/leocoinsin1/npm-debug.log npm ERR! code 1

Si tout fois vous souhaitez avec mon skype pour m'aider c'est "xythox59"