I am doing the tutorials in The Node Beginner Book and I cannot install formidable
because of a version error. Here's the error. I seem to get this error with or without using sudo
and @latest
.
npm install formidable@latest
npm http GET https://registry.npmjs.org/formidable
npm http 304 https://registry.npmjs.org/formidable
npm WARN engine formidable@1.0.13: wanted: {"node":"<0.9.0"} (current: {"node":"v0.10.0","npm":"1.2.14"})
The error means exactly what's stated, the module is expecting a Node version before 0.9.0 and your current version is 0.10.0.
wanted: {"node":"<0.9.0"}
current: {"node":"v0.10.0","npm":"1.2.14"}
An easy solution to this would be using an older version of Node, which you can easily get from the Node repository.
You can also use n , which allows you to easily switch between or install multiple node binaries.
npm install -g n
n 0.8.9
//installs node version 0.8.9
If you won't need the binary later, you can remove it easily.
n rm 0.8.9
转到github中的readme.md,它将显示npm install命令以及git clone命令,如果npm安装失败,该命令应该可以使用。
git clone git://github.com/felixge/node-formidable.git formidable
try a fork of formidable that supposedly supported 0.10.x:
I had the same exact problem with my node v0.10.25 after running the below code.
> npm install formidable@latest
npm http GET https://registry.npmjs.org/formidable
npm http 304 https://registry.npmjs.org/formidable
I change the instruction to
> npm install formidable@1.0.2
It's now working perfectly fine. I suppose the latest version is incompatible.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.