Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
576 views
in Technique[技术] by (71.8m points)

node.js - node error cannot find module already installed

[root@zexu websocket_start]# npm ls -g installed
npm WARN ls doesn't take positional args. Try the 'search' command
npm WARN websocket-server@1.4.04 package.json: bugs['web'] should probably be bugs['url']
/usr/lib
├─┬ npm@1.1.2 
│ ├── abbrev@1.0.3 
│ ├── block-stream@0.0.5 
│ ├── fast-list@1.0.2 
│ ├── fstream@0.1.12 
│ ├── graceful-fs@1.1.5 
│ ├── inherits@1.0.0 
│ ├── ini@1.0.2 
│ ├── lru-cache@1.0.5 
│ ├── minimatch@0.1.5 
│ ├── mkdirp@0.3.0 
│ ├── node-uuid@1.3.3 
│ ├── nopt@1.0.10 
│ ├── proto-list@1.0.0 
│ ├── read@0.0.1 
│ ├── request@2.9.151 
│ ├── rimraf@2.0.1 
│ ├── semver@1.0.13 
│ ├── slide@1.1.3 
│ ├── tar@0.1.12 
│ └── which@1.0.3 
└── websocket-server@1.4.04 
[root@zexu websocket_start]# npm ls  installed
npm WARN ls doesn't take positional args. Try the 'search' command
/home/qonco/workspace/JS/websocket_start
(empty)
[root@zexu websocket_start]# node
> require("websocket-server");
Error: Cannot find module 'websocket-server'
    at Function._resolveFilename (module.js:332:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:354:17)
    at require (module.js:370:17)
    at repl:1:1
    at REPLServer.eval (repl.js:80:21)
    at repl.js:190:20
    at REPLServer.eval (repl.js:87:5)
    at Interface. (repl.js:182:12)
    at Interface.emit (events.js:67:17)
> 

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

you have installed the module global go to your app and try this to link the global to your application folder

   sudo npm link <MODULeNAME> 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...