wenn ich Segel lasse -v, Segel hebe oder sogar npm installiere, erhalte ich diese Fehlermeldung. Bitte helfen Sie -
Error: Cannot find module 'commander'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/local/lib/node_modules/sails/bin/_commander.js:6:15)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
Das Deinstallieren von sails und das erneute Installieren mit 'Sudo'
Löste das Problem.
npm uninstall sails -g
Sudo npm install sails -g
Höchstwahrscheinlich fehlt commander
in package.json
. Installieren Sie es und fügen Sie es zu package.json
Hinzu, indem Sie Folgendes ausführen:
npm install commander --save
Installieren Sie commander
global.
Sudo npm install commander -g
/usr/lib/node_modules/
.In meinem Fall lag es an einer schlechten Version des Knotens. Ich habe versucht, Knoten 8.15.1 und es funktioniert.