项目导入报错解决方法

引入别人gitee或者github代码npm下载模块是报错!!

npm ERR! code 1
npm ERR! path D:\www\wegrow\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 (x86)\nodejs\node.exe D:\www\wegrow\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 (x86)\\nodejs\\node.exe',
npm ERR! gyp verb cli   'D:\\www\\wegrow\\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 node-gyp@3.8.0
npm ERR! gyp info using node@16.1.0 | win32 | ia32
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 (D:\www\wegrow\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (D:\www\wegrow\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (D:\www\wegrow\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at D:\www\wegrow\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at D:\www\wegrow\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at D:\www\wegrow\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:194:21)
npm ERR! gyp verb `which` failed  python2 Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (D:\www\wegrow\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (D:\www\wegrow\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (D:\www\wegrow\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at D:\www\wegrow\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at D:\www\wegrow\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at D:\www\wegrow\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:194: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` succeeded python C:\Python39\python.EXE
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Python39\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack   File "<string>", line 1
npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack                       ^
npm ERR! gyp ERR! stack SyntaxError: invalid syntax
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:326:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
npm ERR! gyp ERR! stack     at Socket.<anonymous> (node:internal/child_process:453:11)
npm ERR! gyp ERR! stack     at Socket.emit (node:events:365:28)
npm ERR! gyp ERR! stack     at Pipe.<anonymous> (node:net:661:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "D:\\www\\wegrow\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd D:\www\wegrow\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.1.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\wbalu\AppData\Local\npm-cache\_logs\2021-05-05T10_38_29_779Z-debug.log

解决方法:

我卸载了node-sass,只安装了sass。不再有错误!

npm uninstall node-sass
npm i sass
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
项目导入Eclipse IDE后报错可能是因为项目的配置文件、依赖库或者编码问题引起的。解决这类问题的方法有以下几种: 1. 检查项目配置:首先,确保你的项目配置正确。检查项目的build path,确保所有的依赖库都被正确引入,并且没有缺失。检查项目的JDK版本是否与Eclipse的JDK版本兼容,或者是否与项目的要求一致。还要检查项目的编码设置是否正确,确保项目的编码和Eclipse的编码一致。 2. 重新构建项目:有时候,报错可能是由于构建过程中出现的错误导致的。尝试重新构建项目,清理项目,以及重新编译项目。这可以通过右键点击项目,选择"Clean"来执行。 3. 查看报错信息:Eclipse IDE会显示详细的报错信息,包括错误的行数,错误的类型以及错误的原因。查看报错日志,可以帮助我们更好地理解问题所在。根据报错信息,尝试修复错误的代码,或者查找相关解决方案。 4. 重启Eclipse IDE:有时候,Eclipse IDE可能会出现一些未知的问题,导致导入项目报错。尝试重启Eclipse IDE,然后重新导入项目,看看问题是否得到解决。 5. 检查环境变量:如果项目依赖了某些外部库或工具,在导入项目之前,需要确保这些依赖项已经正确安装,并且相应的环境变量已经设置。检查环境变量是否正确设置,以确保项目能够正常运行。 如果以上方法都不能解决问题,可能需要进一步检查项目的代码、配置文件等内容,或者搜索相关的错误信息、报错日志,来找到更具体的解决方案。在解决问题的过程中,还可以参考Eclipse官方文档、开发者社区或者相应的论坛,获取更多的帮助和指导。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值