npm install gulp-sass的时候出现了这些错误
npm WARN deprecated lodash.assign@4.2.0: This package is deprecated. Use Object.assign.
npm ERR! code ETARGET
npm ERR! notarget No matching version found for ajv@^6.5.5
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'har-validator'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/yiyinglu/.npm/_logs/2018-11-08T03_55_23_559Z-debug.log
好呗,那我就npm install ajv@^6.5.5。然而不行。
npm ERR! code ETARGET
npm ERR! notarget No matching version found for ajv@^6.5.5
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/yiyinglu/.npm/_logs/2018-11-08T03_57_43_195Z-debug.log
在此之前我用yarn来install sass,因为找不到ajv@^ 6.5.5所以可以选择ajv@^ 6.5.4,不过还是会报错T0T
error /Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: /Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/node-sass
Output:
Building: /usr/local/bin/node /Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli '/Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using node-gyp@3.7.0
gyp info using node@10.13.0 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (/Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/which/which.js:80:29)
gyp verb `which` failed at /Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/which/which.js:89:16
gyp verb `which` failed at /Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed python2 { Error: not found: python2
gyp verb `which` failed at getNotFoundError (/Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/which/which.js:80:29)
gyp verb `which` failed at /Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/which/which.js:89:16
gyp verb `which` failed at /Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed stack:
gyp verb `which` failed 'Error: not found: python2\n at getNotFoundError (/Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/which/which.js:13:12)\n at F (/Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/which/which.js:68:19)\n at E (/Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/which/which.js:80:29)\n at /Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/which/which.js:89:16\n at /Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/isexe/index.js:42:5\n at /Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/isexe/mode.js:8:5\n at FSReqWrap.oncomplete (fs.js:154:21)',
gyp verb `which` failed code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python /usr/bin/python
gyp verb check python version `/usr/bin/python -c "import platform; print(platform.python_version());"` returned: "2.7.10\n"
gyp verb get node dir no --target version specified, falling back to host node version: 10.13.0
gyp verb command install [ '10.13.0' ]
gyp verb install input version string "10.13.0"
gyp verb install installing version: 10.13.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 10.13.0
gyp verb ensuring nodedir is created /Users/yiyinglu/.node-gyp/10.13.0
gyp verb created nodedir /Users/yiyinglu/.node-gyp/10.13.0
gyp http GET https://nodejs.org/download/release/v10.13.0/node-v10.13.0-headers.tar.gz
gyp verb download using proxy url: "http://dev-proxy.oa.com:8080"
gyp WARN install got an error, rolling back install
gyp verb command remove [ '10.13.0' ]
gyp verb remove using node-gyp dir: /Users/yiyinglu/.node-gyp
gyp verb remove removing target version: 10.13.0
gyp verb remove removing development files for version: 10.13.0
gyp ERR! configure error
gyp ERR! stack Error: tunneling socket could not be established, statusCode=504
gyp ERR! stack at ClientRequest.onConnect (/Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/tunnel-agent/index.js:166:19)
gyp ERR! stack at Object.onceWrapper (events.js:273:13)
gyp ERR! stack at ClientRequest.emit (events.js:182:13)
gyp ERR! stack at Socket.socketOnData (_http_client.js:474:11)
gyp ERR! stack at Socket.emit (events.js:182:13)
gyp ERR! stack at addChunk (_stream_readable.js:283:12)
gyp ERR! stack at readableAddChunk (_stream_readable.js:264:11)
gyp ERR! stack at Socket.Readable.push (_stream_readable.js:219:10)
gyp ERR! stack at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/bin/node" "/Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/yiyinglu/Documents/work/git/qz-web/weishi-manager/admin/theme/node_modules/node-sass
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
Build failed with error code: 1
有看到类似情况的,https://github.com/sass/node-sass/issues/1781
折腾了半天,没搞定。
好咯,我们转回用npm 吧,绕不过ajv@^6.5.5,然后我就找类似情况的https://stackoverflow.com/questions/44331005/npm-error-no-matching-version-found-for
The version you have specified, or one of your dependencies has specified is not published to npmjs.com
Executing npm view ionic-native
(see docs) the following output is returned for package versions:
As you can see no version higher than 2.9.0
has been published to the npm repository. Strangely they have versions higher than this on GitHub.
好呗,我也来
npm view ajv
ajv@6.5.5 | MIT | deps: 4 | versions: 269
Another JSON Schema Validator
https://github.com/epoberezkin/ajv
dist
.tarball: http://r.tnpm.oa.com/ajv/download/ajv-6.5.5.tgz
.shasum: cf97cdade71c6399a92c6d6c4177381291b781a1
dependencies:
fast-deep-equal: ^2.0.1 fast-json-stable-stringify: ^2.0.0 json-schema-traverse: ^0.4.1 uri-js: ^4.2.2
maintainers:
- blakeembrey <hello@blakeembrey.com>
- esp <e.poberezkin@me.com>
dist-tags:
4.x: 4.11.8 beta: 6.0.0-rc.1 latest: 6.5.5
published 3 days ago by esp <e.poberezkin@me.com>
然后直接install
npm isntall http://r.tnpm.oa.com/ajv/download/ajv-6.5.5.tgz
。。。。。
哇奇迹发生了! 安装成功~
后续就接着装sass,也OK了~!呜呜呜搞定。