Я только что загрузил последнюю версию node.js, и я пытался сделать npm install в одном из моих проектов, но говорю:
Failed at the [email protected] postinstall script.
Я пробовал делать: npm rebuild node-sass --force, который тоже ничего не делал.
Журнал ошибок возвращает следующее:
3209 warn [email protected] requires a peer of @angular/common@^6.0.0
but none is installed. You must install peer dependencies yourself.
3210 warn [email protected] requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
3211 warn [email protected] requires a peer of @angular/platform-browser@^6.0.0 but none is installed. You must install peer dependencies yourself.
3212 warn [email protected] requires a peer of @angular/platform-browser-dynamic@^6.0.0 but none is installed. You must install peer dependencies yourself.
3213 warn [email protected] requires a peer of firebase@^5.0.3 but none is installed. You must install peer dependencies yourself.
3214 warn [email protected] requires a peer of rxjs@^6.0.0 but none is installed. You must install peer dependencies yourself.
3215 warn [email protected] requires a peer of firebase@^2.4.0 || 3.x.x but none is installed. You must install peer dependencies yourself.
3216 warn optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
3217 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
3218 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
3218 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
3218 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
3218 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
3219 verbose stack Error: [email protected] postinstall: `node scripts/build.js`
3219 verbose stack Exit status 1
3219 verbose stack at EventEmitter.<anonymous> (C:\Users\Simon K\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:283:16)
3219 verbose stack at emitTwo (events.js:126:13)
3219 verbose stack at EventEmitter.emit (events.js:214:7)
3219 verbose stack at ChildProcess.<anonymous> (C:\Users\Simon K\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
3219 verbose stack at emitTwo (events.js:126:13)
3219 verbose stack at ChildProcess.emit (events.js:214:7)
3219 verbose stack at maybeClose (internal/child_process.js:925:16)
3219 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
3220 verbose pkgid [email protected]
3221 verbose cwd C:\xampp\htdocs\project x\projectx
3222 verbose Windows_NT 10.0.16299
3223 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Simon K\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
3224 verbose node v8.11.2
3225 verbose npm v6.0.1
3226 error code ELIFECYCLE
3227 error errno 1
3228 error [email protected] postinstall: `node scripts/build.js`
3228 error Exit status 1
3229 error Failed at the [email protected] postinstall script.
3229 error This is probably not a problem with npm. There is likely additional logging output above.
3230 verbose exit [ 1, true ]
и мои версии npm и node:
2 info using [email protected]
3 info using [email protected]
Я также попытался полностью удалить папку node_modules и снова запустить npm install, но это не сработало.
Одна из возможных причин этого может заключаться в том, что перед Я обновил узел, я следил за предложением этого человека: https://github.com/angular/angular-cli/issues/10527
Где он говорит:
- Download and save a local copy of the correct version of node-sass binary - win32-x64-64_binding.node. For example download it to the following location: C:\node-sass\win32-x64-64_binding.node
- Provide reference to the full path of the node-sass binary file in the sass_binary_path npm configuration parameter (in the ~/.npmrc file): npm config set sass_binary_path For example, npm config set sass_binary_path C:\node-sass\win32-x64-64_binding.node
- Run the npm install command again to install @angular/cli correctly.
- Execute ng serve or npm start and your should be past the problem.
Я не знаю, связано ли это ... Я бы так не подумал, так как я обновил узел, пытался принудительно перестроить node-sass, но я не знаю.
Есть идеи / советы, как это исправить? Спасибо!





Удалите только папку node-sass из node_modules и выполните следующую команду
npm install [email protected] --save
Попробуйте эту npm install -f [email protected]
хм .. это могло сработать, но теперь у меня другая ошибка .. есть идеи? i.gyazo.com/8ef6c9fdbefe0d6861288d077d95125c.png
Сейчас это не похоже на ошибку node-sass, попробуйте снова установить npm, не удаляя node_modules, и опубликуйте обновленные журналы.
Попробуйте запустить с этим флагом --unsafe-perm=true
npm i node-sass --unsafe-perm=true
У вас есть привилегии sudo? Попробуйте запустить то же самое с командой sudo
Попробуйте проверить свою версию Node. Возможно, вы используете не ту версию. Используйте NVM для управления версиями.
попробуй это
npm audit
npm audit fix
Это не дает ответа на вопрос. Как только у вас будет достаточно репутация, вы сможете комментировать любой пост; вместо этого дать ответы, не требующие пояснений от спрашивающего. - Из обзора
У меня была такая же проблема, и исправление аудита сработало для меня, потому что есть пара уязвимостей, препятствующих установке
Вы спасли мою жизнь
У меня сработало .. Спасибо.
У меня тоже сработало, привет!
Нет необходимости много делать, вы столкнулись с этой проблемой, потому что вы пытаетесь установить npm [email protected], не зная, совместим ли он с версией вашего PM, поэтому лучшим возможным решением является написать нижеупомянутый команда npm install --save-dev node-sass В результате в вашей системе будет установлен npm sass, совместимый с имеющейся у вас версией npm. Спасибо позже сначала идите и запустите команду
У него даже не было папки
node-sassвnode_modules