![](/img/trans.png)
[英]running 'npm install' : Node-gyp error - MSBUILD.exe failed with exit code: 1
[英]npm install with error: `gyp` failed with exit code: 1
我嘗試使用 npm 5.6.0 在 Windows 10 上安裝模塊。 當我輸入 npm install 時,我得到:
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\xiaooming\Desktop\app\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xiaooming\\Desktop\\app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\xiaooming\Desktop\app\node_modules\node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN kingt4.0app@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xiaooming\AppData\Roaming\npm-cache\_logs\2018-03-18T13_02_03_946Z-debug.log
似乎是node-sass
安裝錯誤。 環境如下:
Python 版本:2.7.14
npm 版本:5.6.0
節點版本:8.10.0
ruby 版本:2.3.3p222(2016-11-21 修訂版 56859)[i386-mingw32]
系統:win10(x64)
節點石膏:3.6.2
並且我已經安裝了Microsoft Visual Studio express 2015,下面的命令已經執行:
npm config set msvs_version 2015
node-gyp configure --msvs_version=2015
npm install --global --production windows-build-tools
{
"name": "kingt4.0app",
"version": "1.0.0",
"description": "an kingt4.0 project.",
"main": "index.js",
"scripts": {
"test": "test.js"
},
"keywords": [
"finance"
],
"author": "kingdom",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.11.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-cache": "^0.4.2",
"gulp-changed": "^1.3.2",
"gulp-clean-css": "^2.0.2",
"gulp-file-include": "^0.13.7",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp.spritesmith": "^6.2.1",
"imagemin-jpegtran": "^4.3.2",
"imagemin-pngquant": "^4.2.2",
"merge-stream": "^1.0.0",
"normalize.css": "^4.0.0",
"spritesheet-templates": "^10.1.2",
"vinyl-buffer": "^1.0.0"
},
"dependencies": {
"remodal": "^1.0.7",
"slick-carousel": "^1.6.0"
}
}
如何解決這個問題? 感謝幫助。
我嘗試使用npm 5.6.0在Windows 10上安裝模塊。 當我輸入npm install時,我得到:
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\xiaooming\Desktop\app\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xiaooming\\Desktop\\app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\xiaooming\Desktop\app\node_modules\node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN kingt4.0app@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xiaooming\AppData\Roaming\npm-cache\_logs\2018-03-18T13_02_03_946Z-debug.log
似乎是node-sass安裝錯誤。 以下是環境:
python版本:2.7.14
npm版本:5.6.0
節點版本:8.10.0
紅寶石版本:2.3.3p222(2016-11-21修訂版56859)[i386-mingw32]
系統:win10(x64)
node-gyp:3.6.2
並且我已經安裝了Microsoft Visual Studio Express 2015,下面的命令已執行:
npm config set msvs_version 2015
node-gyp configure --msvs_version=2015
npm install --global --production windows-build-tools
package.json是:
{
"name": "kingt4.0app",
"version": "1.0.0",
"description": "an kingt4.0 project.",
"main": "index.js",
"scripts": {
"test": "test.js"
},
"keywords": [
"finance"
],
"author": "kingdom",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.11.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-cache": "^0.4.2",
"gulp-changed": "^1.3.2",
"gulp-clean-css": "^2.0.2",
"gulp-file-include": "^0.13.7",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp.spritesmith": "^6.2.1",
"imagemin-jpegtran": "^4.3.2",
"imagemin-pngquant": "^4.2.2",
"merge-stream": "^1.0.0",
"normalize.css": "^4.0.0",
"spritesheet-templates": "^10.1.2",
"vinyl-buffer": "^1.0.0"
},
"dependencies": {
"remodal": "^1.0.7",
"slick-carousel": "^1.6.0"
}
}
如何解決這個問題? 感謝幫助。
我嘗試使用npm 5.6.0在Windows 10上安裝模塊。 當我輸入npm install時,我得到:
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\xiaooming\Desktop\app\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xiaooming\\Desktop\\app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\xiaooming\Desktop\app\node_modules\node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN kingt4.0app@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xiaooming\AppData\Roaming\npm-cache\_logs\2018-03-18T13_02_03_946Z-debug.log
似乎是node-sass安裝錯誤。 以下是環境:
python版本:2.7.14
npm版本:5.6.0
節點版本:8.10.0
紅寶石版本:2.3.3p222(2016-11-21修訂版56859)[i386-mingw32]
系統:win10(x64)
node-gyp:3.6.2
並且我已經安裝了Microsoft Visual Studio Express 2015,下面的命令已執行:
npm config set msvs_version 2015
node-gyp configure --msvs_version=2015
npm install --global --production windows-build-tools
package.json是:
{
"name": "kingt4.0app",
"version": "1.0.0",
"description": "an kingt4.0 project.",
"main": "index.js",
"scripts": {
"test": "test.js"
},
"keywords": [
"finance"
],
"author": "kingdom",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.11.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-cache": "^0.4.2",
"gulp-changed": "^1.3.2",
"gulp-clean-css": "^2.0.2",
"gulp-file-include": "^0.13.7",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp.spritesmith": "^6.2.1",
"imagemin-jpegtran": "^4.3.2",
"imagemin-pngquant": "^4.2.2",
"merge-stream": "^1.0.0",
"normalize.css": "^4.0.0",
"spritesheet-templates": "^10.1.2",
"vinyl-buffer": "^1.0.0"
},
"dependencies": {
"remodal": "^1.0.7",
"slick-carousel": "^1.6.0"
}
}
如何解決這個問題? 感謝幫助。
$ npm i --ignore-script
我嘗試了不同的方法來解決這個問題,最后,這個評論只是幫助安裝節點包而沒有任何錯誤。
我嘗試使用npm 5.6.0在Windows 10上安裝模塊。 當我輸入npm install時,我得到:
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\xiaooming\Desktop\app\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xiaooming\\Desktop\\app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\xiaooming\Desktop\app\node_modules\node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN kingt4.0app@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xiaooming\AppData\Roaming\npm-cache\_logs\2018-03-18T13_02_03_946Z-debug.log
似乎是node-sass安裝錯誤。 以下是環境:
python版本:2.7.14
npm版本:5.6.0
節點版本:8.10.0
紅寶石版本:2.3.3p222(2016-11-21修訂版56859)[i386-mingw32]
系統:win10(x64)
node-gyp:3.6.2
並且我已經安裝了Microsoft Visual Studio Express 2015,下面的命令已執行:
npm config set msvs_version 2015
node-gyp configure --msvs_version=2015
npm install --global --production windows-build-tools
package.json是:
{
"name": "kingt4.0app",
"version": "1.0.0",
"description": "an kingt4.0 project.",
"main": "index.js",
"scripts": {
"test": "test.js"
},
"keywords": [
"finance"
],
"author": "kingdom",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.11.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-cache": "^0.4.2",
"gulp-changed": "^1.3.2",
"gulp-clean-css": "^2.0.2",
"gulp-file-include": "^0.13.7",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp.spritesmith": "^6.2.1",
"imagemin-jpegtran": "^4.3.2",
"imagemin-pngquant": "^4.2.2",
"merge-stream": "^1.0.0",
"normalize.css": "^4.0.0",
"spritesheet-templates": "^10.1.2",
"vinyl-buffer": "^1.0.0"
},
"dependencies": {
"remodal": "^1.0.7",
"slick-carousel": "^1.6.0"
}
}
如何解決這個問題? 感謝幫助。
我嘗試使用npm 5.6.0在Windows 10上安裝模塊。 當我輸入npm install時,我得到:
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\xiaooming\Desktop\app\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xiaooming\\Desktop\\app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\xiaooming\Desktop\app\node_modules\node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN kingt4.0app@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xiaooming\AppData\Roaming\npm-cache\_logs\2018-03-18T13_02_03_946Z-debug.log
似乎是node-sass安裝錯誤。 以下是環境:
python版本:2.7.14
npm版本:5.6.0
節點版本:8.10.0
紅寶石版本:2.3.3p222(2016-11-21修訂版56859)[i386-mingw32]
系統:win10(x64)
node-gyp:3.6.2
並且我已經安裝了Microsoft Visual Studio Express 2015,下面的命令已執行:
npm config set msvs_version 2015
node-gyp configure --msvs_version=2015
npm install --global --production windows-build-tools
package.json是:
{
"name": "kingt4.0app",
"version": "1.0.0",
"description": "an kingt4.0 project.",
"main": "index.js",
"scripts": {
"test": "test.js"
},
"keywords": [
"finance"
],
"author": "kingdom",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.11.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-cache": "^0.4.2",
"gulp-changed": "^1.3.2",
"gulp-clean-css": "^2.0.2",
"gulp-file-include": "^0.13.7",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp.spritesmith": "^6.2.1",
"imagemin-jpegtran": "^4.3.2",
"imagemin-pngquant": "^4.2.2",
"merge-stream": "^1.0.0",
"normalize.css": "^4.0.0",
"spritesheet-templates": "^10.1.2",
"vinyl-buffer": "^1.0.0"
},
"dependencies": {
"remodal": "^1.0.7",
"slick-carousel": "^1.6.0"
}
}
如何解決這個問題? 感謝幫助。
我嘗試使用npm 5.6.0在Windows 10上安裝模塊。 當我輸入npm install時,我得到:
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\xiaooming\Desktop\app\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xiaooming\\Desktop\\app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\xiaooming\Desktop\app\node_modules\node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN kingt4.0app@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xiaooming\AppData\Roaming\npm-cache\_logs\2018-03-18T13_02_03_946Z-debug.log
似乎是node-sass安裝錯誤。 以下是環境:
python版本:2.7.14
npm版本:5.6.0
節點版本:8.10.0
紅寶石版本:2.3.3p222(2016-11-21修訂版56859)[i386-mingw32]
系統:win10(x64)
node-gyp:3.6.2
並且我已經安裝了Microsoft Visual Studio Express 2015,下面的命令已執行:
npm config set msvs_version 2015
node-gyp configure --msvs_version=2015
npm install --global --production windows-build-tools
package.json是:
{
"name": "kingt4.0app",
"version": "1.0.0",
"description": "an kingt4.0 project.",
"main": "index.js",
"scripts": {
"test": "test.js"
},
"keywords": [
"finance"
],
"author": "kingdom",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.11.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-cache": "^0.4.2",
"gulp-changed": "^1.3.2",
"gulp-clean-css": "^2.0.2",
"gulp-file-include": "^0.13.7",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp.spritesmith": "^6.2.1",
"imagemin-jpegtran": "^4.3.2",
"imagemin-pngquant": "^4.2.2",
"merge-stream": "^1.0.0",
"normalize.css": "^4.0.0",
"spritesheet-templates": "^10.1.2",
"vinyl-buffer": "^1.0.0"
},
"dependencies": {
"remodal": "^1.0.7",
"slick-carousel": "^1.6.0"
}
}
如何解決這個問題? 感謝幫助。
我嘗試使用npm 5.6.0在Windows 10上安裝模塊。 當我輸入npm install時,我得到:
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\xiaooming\Desktop\app\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xiaooming\\Desktop\\app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\xiaooming\Desktop\app\node_modules\node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN kingt4.0app@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xiaooming\AppData\Roaming\npm-cache\_logs\2018-03-18T13_02_03_946Z-debug.log
似乎是node-sass安裝錯誤。 以下是環境:
python版本:2.7.14
npm版本:5.6.0
節點版本:8.10.0
紅寶石版本:2.3.3p222(2016-11-21修訂版56859)[i386-mingw32]
系統:win10(x64)
node-gyp:3.6.2
並且我已經安裝了Microsoft Visual Studio Express 2015,下面的命令已執行:
npm config set msvs_version 2015
node-gyp configure --msvs_version=2015
npm install --global --production windows-build-tools
package.json是:
{
"name": "kingt4.0app",
"version": "1.0.0",
"description": "an kingt4.0 project.",
"main": "index.js",
"scripts": {
"test": "test.js"
},
"keywords": [
"finance"
],
"author": "kingdom",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.11.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-cache": "^0.4.2",
"gulp-changed": "^1.3.2",
"gulp-clean-css": "^2.0.2",
"gulp-file-include": "^0.13.7",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp.spritesmith": "^6.2.1",
"imagemin-jpegtran": "^4.3.2",
"imagemin-pngquant": "^4.2.2",
"merge-stream": "^1.0.0",
"normalize.css": "^4.0.0",
"spritesheet-templates": "^10.1.2",
"vinyl-buffer": "^1.0.0"
},
"dependencies": {
"remodal": "^1.0.7",
"slick-carousel": "^1.6.0"
}
}
如何解決這個問題? 感謝幫助。
我嘗試使用npm 5.6.0在Windows 10上安裝模塊。 當我輸入npm install時,我得到:
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\xiaooming\Desktop\app\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xiaooming\\Desktop\\app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\xiaooming\Desktop\app\node_modules\node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN kingt4.0app@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xiaooming\AppData\Roaming\npm-cache\_logs\2018-03-18T13_02_03_946Z-debug.log
似乎是node-sass安裝錯誤。 以下是環境:
python版本:2.7.14
npm版本:5.6.0
節點版本:8.10.0
紅寶石版本:2.3.3p222(2016-11-21修訂版56859)[i386-mingw32]
系統:win10(x64)
node-gyp:3.6.2
並且我已經安裝了Microsoft Visual Studio Express 2015,下面的命令已執行:
npm config set msvs_version 2015
node-gyp configure --msvs_version=2015
npm install --global --production windows-build-tools
package.json是:
{
"name": "kingt4.0app",
"version": "1.0.0",
"description": "an kingt4.0 project.",
"main": "index.js",
"scripts": {
"test": "test.js"
},
"keywords": [
"finance"
],
"author": "kingdom",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.11.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-cache": "^0.4.2",
"gulp-changed": "^1.3.2",
"gulp-clean-css": "^2.0.2",
"gulp-file-include": "^0.13.7",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp.spritesmith": "^6.2.1",
"imagemin-jpegtran": "^4.3.2",
"imagemin-pngquant": "^4.2.2",
"merge-stream": "^1.0.0",
"normalize.css": "^4.0.0",
"spritesheet-templates": "^10.1.2",
"vinyl-buffer": "^1.0.0"
},
"dependencies": {
"remodal": "^1.0.7",
"slick-carousel": "^1.6.0"
}
}
如何解決這個問題? 感謝幫助。
我嘗試使用npm 5.6.0在Windows 10上安裝模塊。 當我輸入npm install時,我得到:
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\xiaooming\Desktop\app\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xiaooming\\Desktop\\app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\xiaooming\Desktop\app\node_modules\node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN kingt4.0app@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xiaooming\AppData\Roaming\npm-cache\_logs\2018-03-18T13_02_03_946Z-debug.log
似乎是node-sass安裝錯誤。 以下是環境:
python版本:2.7.14
npm版本:5.6.0
節點版本:8.10.0
紅寶石版本:2.3.3p222(2016-11-21修訂版56859)[i386-mingw32]
系統:win10(x64)
node-gyp:3.6.2
並且我已經安裝了Microsoft Visual Studio Express 2015,下面的命令已執行:
npm config set msvs_version 2015
node-gyp configure --msvs_version=2015
npm install --global --production windows-build-tools
package.json是:
{
"name": "kingt4.0app",
"version": "1.0.0",
"description": "an kingt4.0 project.",
"main": "index.js",
"scripts": {
"test": "test.js"
},
"keywords": [
"finance"
],
"author": "kingdom",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.11.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-cache": "^0.4.2",
"gulp-changed": "^1.3.2",
"gulp-clean-css": "^2.0.2",
"gulp-file-include": "^0.13.7",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp.spritesmith": "^6.2.1",
"imagemin-jpegtran": "^4.3.2",
"imagemin-pngquant": "^4.2.2",
"merge-stream": "^1.0.0",
"normalize.css": "^4.0.0",
"spritesheet-templates": "^10.1.2",
"vinyl-buffer": "^1.0.0"
},
"dependencies": {
"remodal": "^1.0.7",
"slick-carousel": "^1.6.0"
}
}
如何解決這個問題? 感謝幫助。
我嘗試使用npm 5.6.0在Windows 10上安裝模塊。 當我輸入npm install時,我得到:
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\xiaooming\Desktop\app\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xiaooming\\Desktop\\app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\xiaooming\Desktop\app\node_modules\node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN kingt4.0app@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xiaooming\AppData\Roaming\npm-cache\_logs\2018-03-18T13_02_03_946Z-debug.log
似乎是node-sass安裝錯誤。 以下是環境:
python版本:2.7.14
npm版本:5.6.0
節點版本:8.10.0
紅寶石版本:2.3.3p222(2016-11-21修訂版56859)[i386-mingw32]
系統:win10(x64)
node-gyp:3.6.2
並且我已經安裝了Microsoft Visual Studio Express 2015,下面的命令已執行:
npm config set msvs_version 2015
node-gyp configure --msvs_version=2015
npm install --global --production windows-build-tools
package.json是:
{
"name": "kingt4.0app",
"version": "1.0.0",
"description": "an kingt4.0 project.",
"main": "index.js",
"scripts": {
"test": "test.js"
},
"keywords": [
"finance"
],
"author": "kingdom",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.11.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-cache": "^0.4.2",
"gulp-changed": "^1.3.2",
"gulp-clean-css": "^2.0.2",
"gulp-file-include": "^0.13.7",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp.spritesmith": "^6.2.1",
"imagemin-jpegtran": "^4.3.2",
"imagemin-pngquant": "^4.2.2",
"merge-stream": "^1.0.0",
"normalize.css": "^4.0.0",
"spritesheet-templates": "^10.1.2",
"vinyl-buffer": "^1.0.0"
},
"dependencies": {
"remodal": "^1.0.7",
"slick-carousel": "^1.6.0"
}
}
如何解決這個問題? 感謝幫助。
我嘗試使用npm 5.6.0在Windows 10上安裝模塊。 當我輸入npm install時,我得到:
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\xiaooming\Desktop\app\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xiaooming\\Desktop\\app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\xiaooming\Desktop\app\node_modules\node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN kingt4.0app@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xiaooming\AppData\Roaming\npm-cache\_logs\2018-03-18T13_02_03_946Z-debug.log
似乎是node-sass安裝錯誤。 以下是環境:
python版本:2.7.14
npm版本:5.6.0
節點版本:8.10.0
紅寶石版本:2.3.3p222(2016-11-21修訂版56859)[i386-mingw32]
系統:win10(x64)
node-gyp:3.6.2
並且我已經安裝了Microsoft Visual Studio Express 2015,下面的命令已執行:
npm config set msvs_version 2015
node-gyp configure --msvs_version=2015
npm install --global --production windows-build-tools
package.json是:
{
"name": "kingt4.0app",
"version": "1.0.0",
"description": "an kingt4.0 project.",
"main": "index.js",
"scripts": {
"test": "test.js"
},
"keywords": [
"finance"
],
"author": "kingdom",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.11.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-cache": "^0.4.2",
"gulp-changed": "^1.3.2",
"gulp-clean-css": "^2.0.2",
"gulp-file-include": "^0.13.7",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp.spritesmith": "^6.2.1",
"imagemin-jpegtran": "^4.3.2",
"imagemin-pngquant": "^4.2.2",
"merge-stream": "^1.0.0",
"normalize.css": "^4.0.0",
"spritesheet-templates": "^10.1.2",
"vinyl-buffer": "^1.0.0"
},
"dependencies": {
"remodal": "^1.0.7",
"slick-carousel": "^1.6.0"
}
}
如何解決這個問題? 感謝幫助。
我嘗試使用npm 5.6.0在Windows 10上安裝模塊。 當我輸入npm install時,我得到:
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\xiaooming\Desktop\app\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xiaooming\\Desktop\\app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\xiaooming\Desktop\app\node_modules\node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN kingt4.0app@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xiaooming\AppData\Roaming\npm-cache\_logs\2018-03-18T13_02_03_946Z-debug.log
似乎是node-sass安裝錯誤。 以下是環境:
python版本:2.7.14
npm版本:5.6.0
節點版本:8.10.0
紅寶石版本:2.3.3p222(2016-11-21修訂版56859)[i386-mingw32]
系統:win10(x64)
node-gyp:3.6.2
並且我已經安裝了Microsoft Visual Studio Express 2015,下面的命令已執行:
npm config set msvs_version 2015
node-gyp configure --msvs_version=2015
npm install --global --production windows-build-tools
package.json是:
{
"name": "kingt4.0app",
"version": "1.0.0",
"description": "an kingt4.0 project.",
"main": "index.js",
"scripts": {
"test": "test.js"
},
"keywords": [
"finance"
],
"author": "kingdom",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.11.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-cache": "^0.4.2",
"gulp-changed": "^1.3.2",
"gulp-clean-css": "^2.0.2",
"gulp-file-include": "^0.13.7",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp.spritesmith": "^6.2.1",
"imagemin-jpegtran": "^4.3.2",
"imagemin-pngquant": "^4.2.2",
"merge-stream": "^1.0.0",
"normalize.css": "^4.0.0",
"spritesheet-templates": "^10.1.2",
"vinyl-buffer": "^1.0.0"
},
"dependencies": {
"remodal": "^1.0.7",
"slick-carousel": "^1.6.0"
}
}
如何解決這個問題? 感謝幫助。
如果您觀看某種舊教程並想從 NPM 安裝webworker-threads ,您應該知道它是 Node JS 的一部分。
const { Worker } = require('worker_threads');
您可以在此處查看有關差異的更多信息https://nodejs.org/api/worker_threads.html
這個錯誤是由於包過時造成的,也可能是由於 nodejs、npm 或其他包以及包管理器的版本更改,要解決它,您必須刪除節點模塊並執行命令:
npm i --ignore-script
可能 node-sass 給你一個錯誤,因為它已經過時了,所以安裝 npm sass 或者如果它是任何其他包,只需檢查當前版本並更新它
我不得不更新到 dart-sass,仍在使用已棄用的 node-sass。 https:\/\/github.com\/sass\/dart-sass#from-npm<\/a>
" 我在為現有的 vuejs 應用程序之一進行 npm 安裝時遇到了類似的問題。 最初它抱怨缺少 python。安裝 python 后,我開始收到此錯誤 - gyp ERR: stack Error: gyp
failed with exit code: 1
后來才知道項目還有package-lock.json。 我刪除了它並進行了 npm 安裝。 它有效,.. 因此,如果您遇到類似的問題,並且還有 package-lock.json,請嘗試將其刪除。
我在macOS
上被這個問題困擾了很長時間。 對我來說,在 macOS 上,我必須
我也安裝xcode
,但是沒有效果
我通過更改節點版本解決了這個問題。
我使用 nvm 來處理多個節點版本。 我使用的是節點 v14.x 和 npm v6.x,我不得不將節點更改為 16.x 和 npm 8.x
我做了:
nvm use 16
如果沒有 nvm,則需要使用 brew 安裝它:
brew install nvm
我知道此錯誤可能有多個修復程序,但這對我有用。
后來編輯:我也從 node-sass 切換到 sass,因為不再維護 node-sass 並且遷移並不那么復雜。 您可以在此處查看如何執行此操作。
按照以下安裝步驟在 MacOS 上運行:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
然后新開一個 shell session。npm install --global yarn
node gpu-test.js
測試文件示例gpu-test.js
:
const { GPU } = require('gpu.js');
const gpu = new GPU();
const multiplyMatrix = gpu.createKernel(function(a, b) {
let sum = 0;
for (let i = 0; i < 2; i++) {
sum += a[this.thread.y][i] * b[i][this.thread.x];
}
return sum;
}).setOutput([2, 2]);
const a = new Array(2).fill(new Array(2).fill(1));
const c = multiplyMatrix(a, a);
console.log(a);
console.log(c);
如果您安裝了 Python 3.11,也會發生這種情況,如此處所述https://stackoverflow.com/a/74732671/2630344
我通過使用無法安裝的 gyp 庫的 node-sass 或 gulp-sass 從 web 開發上下文遇到了這個問題。 tldr; 太舊了,升級到 sass這樣可以避免 gyp 問題
對這個問題做了一些深入的調查。 有幾個人可能遇到過這個問題,因為他們在開發中嘗試使用依賴於node-sass
gulp-sass
,並且這個 gyp 問題突然出現。
最初在安裝 gulp-sass 時彈出一個錯誤,抱怨我的電腦中沒有安裝 python2.7。 一旦我安裝了它,由於最新節點和 gyp 的不兼容,gyp 問題就出現了。 我的解決方案是使用最新的 gulp 和最新的 sass。希望這對從 web 開發來到這里的任何人有所幫助。
您可能需要將sass
中的node-sass
更改為package.json
,如node-sass
的官方頁面所述(請參閱此處):
警告:LibSass 和 Node Sass 已棄用。 雖然他們將繼續無限期地接收維護版本,但沒有計划添加其他功能或與任何新的 CSS 或 Sass 功能兼容。 仍在使用它的項目應該轉移到 Dart Sass。
我嘗試使用npm 5.6.0在Windows 10上安裝模塊。 當我輸入npm install時,我得到:
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\xiaooming\Desktop\app\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xiaooming\\Desktop\\app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\xiaooming\Desktop\app\node_modules\node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN kingt4.0app@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xiaooming\AppData\Roaming\npm-cache\_logs\2018-03-18T13_02_03_946Z-debug.log
似乎是node-sass安裝錯誤。 以下是環境:
python版本:2.7.14
npm版本:5.6.0
節點版本:8.10.0
紅寶石版本:2.3.3p222(2016-11-21修訂版56859)[i386-mingw32]
系統:win10(x64)
node-gyp:3.6.2
並且我已經安裝了Microsoft Visual Studio Express 2015,下面的命令已執行:
npm config set msvs_version 2015
node-gyp configure --msvs_version=2015
npm install --global --production windows-build-tools
package.json是:
{
"name": "kingt4.0app",
"version": "1.0.0",
"description": "an kingt4.0 project.",
"main": "index.js",
"scripts": {
"test": "test.js"
},
"keywords": [
"finance"
],
"author": "kingdom",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.11.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-cache": "^0.4.2",
"gulp-changed": "^1.3.2",
"gulp-clean-css": "^2.0.2",
"gulp-file-include": "^0.13.7",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp.spritesmith": "^6.2.1",
"imagemin-jpegtran": "^4.3.2",
"imagemin-pngquant": "^4.2.2",
"merge-stream": "^1.0.0",
"normalize.css": "^4.0.0",
"spritesheet-templates": "^10.1.2",
"vinyl-buffer": "^1.0.0"
},
"dependencies": {
"remodal": "^1.0.7",
"slick-carousel": "^1.6.0"
}
}
如何解決這個問題? 感謝幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.