在 PyCharm 中创建 node.js app 的时候报告 Express version is unavailable 错误求解 ~

2014-12-29 20:50:49 +08:00
 Feiox
R.T.
Pythoner 初学 node 这问题。Google 了一圈,发现没解决方案
注,已 npm install express -g 了
6694 次点击
所在节点    Node.js
7 条回复
StevenSLXie
2014-12-29 21:02:00 +08:00
可以贴上你的package.json文件?
Delbert
2014-12-29 21:11:29 +08:00
参考 http://delbert.me/archives/719.html ,我觉得你应该用
$ npm install -g express-generator@4

$ npm install -g express-generator
这个命令。
Feiox
2014-12-29 22:03:26 +08:00
@StevenSLXie 这是 npm/package.json 文件,@Delbert 依旧是不行。。。
{
"version": "2.1.11",
"name": "npm",
"description": "A package manager for node",
"keywords": [
"package manager",
"modules",
"install",
"package.json"
],
"preferGlobal": true,
"config": {
"publishtest": false
},
"homepage": "https://npmjs.org/doc/",
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
"repository": {
"type": "git",
"url": "https://github.com/npm/npm"
},
"bugs": {
"email": "npm-@googlegroups.com",
"url": "http://github.com/npm/npm/issues"
},
"directories": {
"doc": "./doc",
"man": "./man",
"lib": "./lib",
"bin": "./bin"
},
"main": "./lib/npm.js",
"bin": "./bin/npm-cli.js",
"dependencies": {
"abbrev": "~1.0.5",
"ansi": "~0.3.0",
"ansicolors": "~0.3.2",
"ansistyles": "~0.1.3",
"archy": "~1.0.0",
"async-some": "~1.0.1",
"block-stream": "0.0.7",
"char-spinner": "~1.0.1",
"child-process-close": "~0.1.1",
"chmodr": "~0.1.0",
"chownr": "0",
"cmd-shim": "~2.0.1",
"columnify": "~1.2.1",
"config-chain": "~1.1.8",
"dezalgo": "~1.0.1",
"editor": "~0.1.0",
"fs-vacuum": "~1.2.2",
"fs-write-stream-atomic": "~1.0.2",
"fstream": "~1.0.3",
"fstream-npm": "~1.0.1",
"github-url-from-git": "~1.4.0",
"github-url-from-username-repo": "~1.0.2",
"glob": "~4.2.1",
"graceful-fs": "~3.0.4",
"inflight": "~1.0.4",
"inherits": "~2.0.1",
"ini": "~1.3.2",
"init-package-json": "~1.1.2",
"lockfile": "~1.0.0",
"lru-cache": "~2.5.0",
"minimatch": "~1.0.0",
"mkdirp": "~0.5.0",
"node-gyp": "~1.0.1",
"nopt": "~3.0.1",
"normalize-package-data": "~1.0.3",
"npm-cache-filename": "~1.0.1",
"npm-install-checks": "~1.0.2",
"npm-package-arg": "~2.1.3",
"npm-registry-client": "~4.0.4",
"npm-user-validate": "~0.1.1",
"npmlog": "~0.1.1",
"once": "~1.3.1",
"opener": "~1.4.0",
"osenv": "~0.1.0",
"path-is-inside": "~1.0.0",
"read": "~1.0.4",
"read-installed": "~3.1.2",
"read-package-json": "~1.2.7",
"readable-stream": "~1.0.33",
"realize-package-specifier": "~1.3.0",
"request": "~2.48.0",
"retry": "~0.6.1",
"rimraf": "~2.2.8",
"semver": "~4.1.0",
"sha": "~1.3.0",
"slide": "~1.1.6",
"sorted-object": "~1.0.0",
"tar": "~1.0.3",
"text-table": "~0.2.0",
"uid-number": "0.0.6",
"which": "~1.0.7",
"wrappy": "~1.0.1",
"write-file-atomic": "~1.1.0"
},
"bundleDependencies": [
"abbrev",
"ansi",
"ansicolors",
"ansistyles",
"archy",
"async-some",
"block-stream",
"char-spinner",
"child-process-close",
"chmodr",
"chownr",
"cmd-shim",
"columnify",
"config-chain",
"dezalgo",
"editor",
"fs-vacuum",
"fs-write-stream-atomic",
"fstream",
"fstream-npm",
"github-url-from-git",
"github-url-from-username-repo",
"glob",
"graceful-fs",
"inflight",
"inherits",
"ini",
"init-package-json",
"lockfile",
"lru-cache",
"minimatch",
"mkdirp",
"node-gyp",
"nopt",
"normalize-package-data",
"npm-cache-filename",
"npm-install-checks",
"npm-package-arg",
"npm-registry-client",
"npm-user-validate",
"npmlog",
"once",
"opener",
"osenv",
"path-is-inside",
"read",
"read-installed",
"read-package-json",
"readable-stream",
"realize-package-specifier",
"request",
"retry",
"rimraf",
"semver",
"sha",
"slide",
"sorted-object",
"tar",
"text-table",
"uid-number",
"which",
"wrappy",
"write-file-atomic"
],
"devDependencies": {
"marked": "~0.3.2",
"marked-man": "~0.1.4",
"nock": "~0.51.0",
"npm-registry-couchapp": "~2.6.2",
"npm-registry-mock": "~0.6.3",
"require-inject": "~1.1.0",
"tap": "~0.4.12"
},
"scripts": {
"test-legacy": "node ./test/run.js",
"test": "tap --timeout 120 test/tap/*.js",
"tap": "tap --timeout 120 test/tap/*.js",
"test-all": "node ./test/run.js && tap test/tap/*.js",
"prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rm -rf test/*/*/node_modules && make -j8 doc",
"dumpconf": "env | grep npm | sort | uniq"
},
"license": "Artistic-2.0"
}
ETiV
2014-12-29 22:55:23 +08:00
看来LZ确实是新手。

错误提示是在「创建」“Express App”的时候提示的吗?

其实你也可以直接创建不带模板的node app。然后去项目目录里,用npm link express命令把全局下的那个express库给link到本地目录
ityao
2014-12-30 08:39:44 +08:00
为啥不用webstorm?
blueandhack
2014-12-30 23:36:43 +08:00
你需要的是Webstorm
Feiox
2014-12-31 16:17:02 +08:00
@blueandhack
@ityao 因为已经购买了 PyCharm 的个人版。。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/157708

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX