0

我正在尝试安装 express,但无法通过此“tobi-cookie”错误。

几天前我通过npm安装了 Connect ,它说它缺少 tobi-cookie。

然后我安装了 tobi-cookie

今天我试图安装 Express,并得到了这个:

[root@dsusim:/home/GUIServer]$ npm info express version
npm http GET http://registry.npmjs.org/express
npm ERR! TypeError: Cannot read property 'url' of undefined
npm ERR!     at new Cookie (/usr/lib/node_modules/tobi-cookie/index.js:46:20)
npm ERR!     at addCookie (/usr/lib/node_modules/request/main.js:586:26)
npm ERR!     at Array.forEach (native)
npm ERR!     at ClientRequest.<anonymous> (/usr/lib/node_modules/request/main.js:590:89)
npm ERR!     at ClientRequest.g (events.js:175:14)
npm ERR!     at ClientRequest.EventEmitter.emit (events.js:95:17)
npm ERR!     at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1628:21)
npm ERR!     at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:119:23)
npm ERR!     at Socket.socketOnData [as ondata] (http.js:1523:20)
npm ERR!     at TCP.onread (net.js:510:27)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.8.7-201.fc18.x86_64
npm ERR! command "node" "/bin/npm" "info" "express" "version"
npm ERR! cwd /home/GUIServer
npm ERR! node -v v0.10.4
npm ERR! npm -v 1.2.14
npm ERR! type non_object_property_load
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/GUIServer/npm-debug.log
npm ERR! not ok code 0

然后我继续“npm 卸载”,然后是“npm rm”tobie-cookie。

现在我遇到了大麻烦......无法安装任何东西:

[root@localhost:/usr/lib]$ npm info express version

module.js:340
    throw err;
          ^
Error: Cannot find module 'tobi-cookie'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/lib/node_modules/request/main.js:26:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

.

[root@localhost:/usr/lib]$ npm install tobi-cookie

module.js:340
    throw err;
          ^
Error: Cannot find module 'tobi-cookie'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/lib/node_modules/request/main.js:26:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

.

[root@localhost:/usr/lib]$ npm install tobi-cookie -g

module.js:340
    throw err;
          ^
Error: Cannot find module 'tobi-cookie'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/lib/node_modules/request/main.js:26:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

.

[root@localhost:/usr/lib]$ ls /usr/lib/node_modules/
abbrev           config-chain      fresh              lru-cache               npmlog               read-installed     socket.io
ansi             connect           fstream            mime                    npm-registry-client  read-package-json  tar
archy            connect-master    fstream-ignore     minimatch               once                 request            uid-number
async            cookie            fstream-npm        mkdirp                  opener               retry              which
block-stream     cookie-signature  glob               mute-stream             osenv                rimraf
buffer-crc32     couch-login       graceful-fs        node-browserify-master  pause                semver
bytes            debug             inherits           node-gyp                promzard             send
chmodr           delayed-stream    ini                nopt                    proto-list           session.socket.io
chownr           form-data         init-package-json  npm                     qs                   sigmund
combined-stream  formidable        lockfile           npmconf                 read                 slide

.

[root@localhost:/home/GUIServer]$ npm update

module.js:340
    throw err;
          ^
Error: Cannot find module 'tobi-cookie'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/lib/node_modules/request/main.js:26:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

.

[root@localhost:/home/GUIServer]$ locate tobi-cookie
/usr/lib/node_modules/tobi-cookie
/usr/lib/node_modules/request/node_modules/tobi-cookie
/usr/share/doc/nodejs-tobi-cookie-0.3.2
/usr/share/doc/nodejs-tobi-cookie-0.3.2/History.md
/usr/share/doc/nodejs-tobi-cookie-0.3.2/Readme.md
4

2 回答 2

2

我使用了这个命令npm link express。为我工作..我重新安装了快递,然后我去了我的项目所在的目录,我执行了npm link epress并找到了。 http://blog.i-evaluation.com/2012/09/17/error-cannot-find-module-express/

于 2013-11-16T06:02:48.070 回答
0

没关系,解决了它:

git clone git://github.com/isaacs/npm.git
cd npm/scripts
chmod +x install.sh
sudo ./install.sh

来自NPM,无论我做什么,都找不到“优雅的 fs”

并且从NPM 无法安装 appjs。错误:找不到模块 'graceful-fs'

然后做了

/bin/npm install express -g
/bin/npm install express
于 2013-06-06T23:34:08.217 回答