安装 Ngx-Admin 时出错
我是 Angular 新手,尝试安装 ngx-admin 模板,但出现了这些错误。如何修复这些错误?
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: CoffeeScript on NPM `enter code here`has moved to "coffeescript" (no hyphen)
npm WARN deprecated @types/[email protected]: Types for the Google Maps browser API have moved to @types/google.maps. Note: these types are not for the googlemaps npm package, which is a Node API.
npm WARN deprecated [email protected]: no longer supported
npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534
for more information.
npm WARN deprecated [email protected]: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because
of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please,
upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: We have renamed the @ckeditor package. New versions are available under the @ckeditor4 name.
npm ERR! code 1
npm ERR! path C:\Users\admin\ngx-admin\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\admin\ngx-admin\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli 'C:\\Users\\admin\\ngx-admin\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (C:\Users\admin\ngx-admin\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (C:\Users\admin\ngx-admin\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (C:\Users\admin\ngx-admin\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed python2 Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (C:\Users\admin\ngx-admin\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (C:\Users\admin\ngx-admin\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (C:\Users\admin\ngx-admin\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python
npm ERR! gyp verb `which` failed at getNotFoundError (C:\Users\admin\ngx-admin\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (C:\Users\admin\ngx-admin\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (C:\Users\admin\ngx-admin\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed python Error: not found: python
npm ERR! gyp verb `which` failed at getNotFoundError (C:\Users\admin\ngx-admin\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (C:\Users\admin\ngx-admin\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (C:\Users\admin\ngx-admin\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb could not find "python". checking python launcher
npm ERR! gyp verb could not find "python". guessing location
npm ERR! gyp verb ensuring that file exists: C:\Python27\python.exe
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack at PythonFinder.failNoPython (C:\Users\admin\ngx-admin\node_modules\node-gyp\lib\configure.js:484:19)
npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\admin\ngx-admin\node_modules\node-gyp\lib\configure.js:509:16)
npm ERR! gyp ERR! stack at C:\Users\admin\ngx-admin\node_modules\graceful-fs\polyfills.js:284:29
npm ERR! gyp ERR! stack at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\admin\\ngx-admin\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\Users\admin\ngx-admin\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Local\npm-cache\_logs\2022-03-21T06_59_03_785Z-debug-0.log
I'm new to Angular and try to install ngx-admin template but I got these errors. how to fix these errors?
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: CoffeeScript on NPM `enter code here`has moved to "coffeescript" (no hyphen)
npm WARN deprecated @types/[email protected]: Types for the Google Maps browser API have moved to @types/google.maps. Note: these types are not for the googlemaps npm package, which is a Node API.
npm WARN deprecated [email protected]: no longer supported
npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534
for more information.
npm WARN deprecated [email protected]: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because
of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please,
upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: We have renamed the @ckeditor package. New versions are available under the @ckeditor4 name.
npm ERR! code 1
npm ERR! path C:\Users\admin\ngx-admin\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\admin\ngx-admin\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli 'C:\\Users\\admin\\ngx-admin\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (C:\Users\admin\ngx-admin\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (C:\Users\admin\ngx-admin\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (C:\Users\admin\ngx-admin\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed python2 Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (C:\Users\admin\ngx-admin\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (C:\Users\admin\ngx-admin\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (C:\Users\admin\ngx-admin\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python
npm ERR! gyp verb `which` failed at getNotFoundError (C:\Users\admin\ngx-admin\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (C:\Users\admin\ngx-admin\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (C:\Users\admin\ngx-admin\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed python Error: not found: python
npm ERR! gyp verb `which` failed at getNotFoundError (C:\Users\admin\ngx-admin\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (C:\Users\admin\ngx-admin\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (C:\Users\admin\ngx-admin\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at C:\Users\admin\ngx-admin\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb could not find "python". checking python launcher
npm ERR! gyp verb could not find "python". guessing location
npm ERR! gyp verb ensuring that file exists: C:\Python27\python.exe
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack at PythonFinder.failNoPython (C:\Users\admin\ngx-admin\node_modules\node-gyp\lib\configure.js:484:19)
npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\admin\ngx-admin\node_modules\node-gyp\lib\configure.js:509:16)
npm ERR! gyp ERR! stack at C:\Users\admin\ngx-admin\node_modules\graceful-fs\polyfills.js:284:29
npm ERR! gyp ERR! stack at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\admin\\ngx-admin\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\Users\admin\ngx-admin\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Local\npm-cache\_logs\2022-03-21T06_59_03_785Z-debug-0.log
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
试试这个:
yarn add node-sass
然后yarn
它对我有用try this:
yarn add node-sass
thenyarn
it works for me只需从
package.json
中删除node-sass
然后运行 npm i -f
他就能正常工作。Just remove
node-sass
frompackage.json
thenrun npm i -f
he will work fine.要修复 node-sass 问题,请将
"node-sass": "xx.xx.x"
更改为"sass": "^1.49.0"
项目根目录中的 >package.json 文件。然后运行 npm i 来安装新包。尽管
node-sass
可能不是 ngx-admin 现在运行的唯一问题。To fix node-sass issue, change
"node-sass": "xx.xx.x"
to"sass": "^1.49.0"
in thepackage.json
file in the root of the project. Then runnpm i
to install new packages.Though
node-sass
may be not the only issue with ngx-admin to make it run nowadays.