首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在创建RASA-NLU天气聊天机器人时运行命令"npm install“时出错

在创建RASA-NLU天气聊天机器人时运行命令"npm install“时出错
EN

Stack Overflow用户
提问于 2022-03-20 09:45:39
回答 1查看 385关注 0票数 0

我正在创建一个RASA-NLU天气聊天机器人。这是我在运行npm 时遇到的错误,并且文件夹"node_modules“没有安装

代码语言:javascript
复制
(rasa_venv) PS E:\github\NLP_ChatBot\chatroom-master> npm install
npm WARN deprecated har-validator@5.1.3: this library is no longer supported
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated @babel/polyfill@7.4.4:  This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
npm WARN deprecated uuid@3.3.3: 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 request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated mkdirp@0.5.1: 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 ecstatic@3.3.2: This package is unmaintained and deprecated. See the GH Issue 259.
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated core-js@2.6.9: 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 ERR! code 1
npm ERR! path E:\github\NLP_ChatBot\chatroom-master\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 E:\github\NLP_ChatBot\chatroom-master\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   'E:\\github\\NLP_ChatBot\\chatroom-master\\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.14.2 | 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 (E:\github\NLP_ChatBot\chatroom-master\node_modules\which\which.js:13:12)     
npm ERR! gyp verb `which` failed     at F (E:\github\NLP_ChatBot\chatroom-master\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (E:\github\NLP_ChatBot\chatroom-master\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at E:\github\NLP_ChatBot\chatroom-master\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at E:\github\NLP_ChatBot\chatroom-master\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at E:\github\NLP_ChatBot\chatroom-master\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 (E:\github\NLP_ChatBot\chatroom-master\node_modules\which\which.js:13:12)     
npm ERR! gyp verb `which` failed     at F (E:\github\NLP_ChatBot\chatroom-master\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (E:\github\NLP_ChatBot\chatroom-master\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at E:\github\NLP_ChatBot\chatroom-master\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at E:\github\NLP_ChatBot\chatroom-master\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at E:\github\NLP_ChatBot\chatroom-master\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` succeeded python E:\github\NLP_ChatBot\rasa_venv\Scripts\python.EXE
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: E:\github\NLP_ChatBot\rasa_venv\Scripts\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:399:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1092:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\github\\NLP_ChatBot\\chatroom-master\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd E:\github\NLP_ChatBot\chatroom-master\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.14.2
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\Dilrose\AppData\Local\npm-cache\_logs\2022-03-20T09_19_45_797Z-debug-0.log

安装了Node.js和npm

代码语言:javascript
复制
(rasa_venv) PS E:\github\NLP_ChatBot\chatroom-master> node -v
v16.14.2
(rasa_venv) PS E:\github\NLP_ChatBot\chatroom-master> npm -v
8.5.0

package.json的内容如下:

代码语言:javascript
复制
{
  "name": "@scalableminds/chatroom",
  "version": "0.12.0",
  "license": "AGPL-3.0",
  "dependencies": {
    "@babel/polyfill": "^7.4.4",
    "classnames": "^2.2.6",
    "date-fns": "^2.0.1",
    "lodash.isequal": "^4.5.0",
    "react": "^16.9.0",
    "react-dom": "^16.9.0",
    "react-icons": "^3.2.1",
    "react-markdown": "^3.3.0",
    "remark-breaks": "^1.0.0",
    "unfetch": "^3.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.5.5",
    "@babel/plugin-proposal-class-properties": "^7.5.5",
    "@babel/plugin-syntax-class-properties": "^7.2.0",
    "@babel/plugin-transform-flow-strip-types": "^7.4.4",
    "@babel/preset-env": "^7.5.5",
    "@babel/preset-react": "^7.0.0",
    "flow-bin": "^0.106.3",
    "http-server": "^0.11.1",
    "node-sass": "^4.8.3",
    "parcel": "^2.0.0",
    "prettier": "^1.14.2"
  },
  "scripts": {
    "build": "parcel build src/index.js --out-file Chatroom.js",
    "watch": "parcel watch src/index.js --out-file Chatroom.js",
    "flow": "flow",
    "pretty": "prettier --write src/*",
    "prepare": "npm build",
    "serve": "http-server"
  },
  "main": "dist/Chatroom.js"
}

我真的不明白确切的问题。请有人帮我解决这个问题。三天后卡住:(

EN

回答 1

Stack Overflow用户

发布于 2022-03-20 10:54:12

Gyp需要Python,而当您在Windows上时。

  • 安装Python并确保将其包含在您的路径中。
  • 尝试使用--没有可选的标志运行npm安装。
  • 尝试下载windows-build-tools包.

https://spin.atomicobject.com/2019/03/27/node-gyp-windows/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71545659

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档