V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Feiox
V2EX  ›  Node.js

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

  •  
  •   Feiox · 2014-12-29 20:50:49 +08:00 · 6853 次点击
    这是一个创建于 3620 天前的主题,其中的信息可能已经有所发展或是发生改变。
    R.T.
    Pythoner 初学 node 这问题。Google 了一圈,发现没解决方案
    注,已 npm install express -g 了
    7 条回复    2014-12-31 16:17:02 +08:00
    StevenSLXie
        1
    StevenSLXie  
       2014-12-29 21:02:00 +08:00
    可以贴上你的package.json文件?
    Delbert
        2
    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
        3
    Feiox  
    OP
       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 <[email protected]> (http://blog.izs.me)",
    "repository": {
    "type": "git",
    "url": "https://github.com/npm/npm"
    },
    "bugs": {
    "email": "[email protected]",
    "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
        4
    ETiV  
       2014-12-29 22:55:23 +08:00 via iPhone
    看来LZ确实是新手。

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

    其实你也可以直接创建不带模板的node app。然后去项目目录里,用npm link express命令把全局下的那个express库给link到本地目录
    ityao
        5
    ityao  
       2014-12-30 08:39:44 +08:00
    为啥不用webstorm?
    blueandhack
        6
    blueandhack  
       2014-12-30 23:36:43 +08:00
    你需要的是Webstorm
    Feiox
        7
    Feiox  
    OP
       2014-12-31 16:17:02 +08:00
    @blueandhack
    @ityao 因为已经购买了 PyCharm 的个人版。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5390 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 09:24 · PVG 17:24 · LAX 01:24 · JFK 04:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.