npm找不到模块tobi

npm找不到模块tobi

本文介绍了npm找不到模块tobi-cookie;npm无法安装Express;Node.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装Express,但无法传递此"tobi-cookie"错误.

I'm trying to install express, but I can't get passed this "tobi-cookie" error.

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

I installed Connect via npm a few days ago, and it said it was missing tobi-cookie.

然后我安装了tobi-cookie .

今天我正尝试安装Express ,并将其恢复:

Today I was trying to install Express, and got this back:

[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!     <[email protected]>

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.

现在我很麻烦...无法安装任何东西:

Now I'm in big trouble... can't install anything:

[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

推荐答案

没关系,用以下方法解决它:

Nevermind, solved it with:

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

来自 NPM,找不到"graceful-fs",无论我做什么

NPM无法安装appjs.错误:找不到模块'graceful-fs'

然后做了

/bin/npm install express -g
/bin/npm install express

这篇关于npm找不到模块tobi-cookie;npm无法安装Express;Node.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 13:15