当我尝试安装节点JS它给了我这个错误
C:\Users\Administrator>cd C:/xampp/htdocs/chat
C:\xampp\htdocs\chat>npm install
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\ node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall getaddrinfo
npm ERR! enoent getaddrinfo ENOENT registry.npmjs.org:443
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! C:\xampp\htdocs\chat\npm-debug.log
我的问题是如何防止这些错误并安装节点JS和插座IO正确。
从他们的网站上安装的NodeJS,那么你的项目文件夹中执行npm init
。
之后,你可以从NPM安装依赖。
刚才看了,什么是在他们的网站下的“入门” ...
我做了NPM初始化,这是我以.json文件
"name": "chat",
"version": "4.5.0",
"description": "IO",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Dan Vasii",
"license": "ISC",
"dependencies":
{
"socket.io" : "*",
"express" : "*"
}
}
下载从https://nodejs.org/en/ Windows安装。
运行安装程序(您在上一步中下载的.msi文件。)
按照提示在安装程序(接受许可协议,单击Next按钮一堆次,接受默认安装设置)。
我建议你从NVM安装
之后。只是不NVM安装检查。你的终端内部节点-v