我是 Angular 新手,尝试安装 ngx-admin 模板,但出现了这些错误。如何修复这些错误?
npm WARN deprecated <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="512424383511627f627f63" rel="noreferrer noopener nofollow">[email protected]</a>: 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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="620f09060b101222524c574c53" rel="noreferrer noopener nofollow">[email protected]</a>: 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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="82e1ede4e4e7e7aff1e1f0ebf2f6c2b3acb3b0acb5" rel="noreferrer noopener nofollow">[email protected]</a>: CoffeeScript on NPM `enter code here`has moved to "coffeescript" (no hyphen)
npm WARN deprecated @types/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="70171f1f171c151d11000330435e44435e43" rel="noreferrer noopener nofollow">[email protected]</a>: 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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="295f405307435a691807110719" rel="noreferrer noopener nofollow">[email protected]</a>: no longer supported
npm WARN deprecated <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6317021123514d514d51" rel="noreferrer noopener nofollow">[email protected]</a>: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="afdbdcc3c6c1dbef99819e819c" rel="noreferrer noopener nofollow">[email protected]</a>: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534
for more information.
npm WARN deprecated <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="593a362b3c74332a196b776c7768" rel="noreferrer noopener nofollow">[email protected]</a>: 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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3c5f5759585548534e7c08120b120f" rel="noreferrer noopener nofollow">[email protected]</a>: 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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8ce2e3e8e9a1ebf5fcccbfa2b4a2bc" rel="noreferrer noopener nofollow">[email protected]</a>
npm ERR! gyp info using <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="81efeee5e4c1b0b7afb0b5afb1" rel="noreferrer noopener nofollow">[email protected]</a> | 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
最佳答案
只需从 package.json
中删除 node-sass
然后运行 npm i -f
他就能正常工作。
关于node.js - 安装 Ngx-Admin 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71554801/