首次尝试运行

时间:2016-04-26 09:39:20

标签: jhipster

  cs@cs-270E5J:~/JHipster$ yo jhipster

    /usr/lib/node_modules/generator-jhipster/generators/app/index.js:15
    const constants = require('../generator-constants');
    ^^^^^
    SyntaxError: Use of const in strict mode.
        at Module._compile (module.js:439:25)
        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)
        at require (module.js:380:17)
        at Object._storeAsPath.Object.defineProperty.get [as jhipster:app] (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/store.js:40:23)
        at Store.get (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/store.js:64:35)
        at Environment.get (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:260:16)
        at Environment.create (/usr/local/lib/node_modules/yo/node_modules/yeoman-environment/lib/environment.js:292:24)
    cs@cs-270E5J:~/JHipster$

我安装了jhipster而没有错误。只有那些:

npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
/usr/lib
└── generator-jhipster@3.1.0 

当我进入jhipster文件夹并尝试使用yo jhipster运行jhipster时,它会在s tart中出错。为什么?我已全部更新

我试图更新自耕农和错误:

npm ERR! Linux 4.2.0-35-generic
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "yo"
npm ERR! node v0.10.25
npm ERR! npm  v3.8.7
npm ERR! path /usr/lib/node_modules
npm ERR! code EACCES

npm ERR! Error: EACCES, access '/usr/lib/node_modules'
npm ERR!     at module.exports (/usr/local/lib/node_modules/npm/lib/install/access-error.js:4:18)
npm ERR!     at /usr/local/lib/node_modules/npm/lib/install/writable.js:30:25
npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:232:16
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR!  { [Error: EACCES, access '/usr/lib/node_modules'] code: 'EACCES', path: '/usr/lib/node_modules' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/caneraydin/npm-debug.log
  

Yeoman医生   在您的系统上运行健全性检查

     

✔主目录中没有.bowerrc文件   ✔全局配置文件有效   ✔NODE_PATH匹配npm根   ✖Node.js版本

我也有错误。当我运行sudo npm install -g npm 但我有最新版本的nodejs?

外观:

  

caneraydin @ caneraydin-270E5J:〜$ sudo apt-get install -y nodejs   阅读包裹清单......完成   建立依赖树
  阅读国家信息......完成   nodejs已经是最新版本了。   以下软件包已自动安装,不再需要:     authbind libcommons-dbcp-java libcommons-pool-java libecj-java     libgeronimo-jta-1.1-spec-java libntdb1 libtomcat7-java     linux-headers-3.13.0-83 linux-headers-3.13.0-83-generic python-ntdb     tomcat7常见   使用' apt-get autoremove'删除它们。   0升级,0新安装,0删除,3未升级。   caneraydin @ caneraydin-270E5J:〜$

2 个答案:

答案 0 :(得分:2)

doc建议使用节点LTS版本,因此0.10.x可能太旧而且不支持const关键字。我认为最老的版本可能是0.12.x,以防您无法升级到最新的LTS。

答案 1 :(得分:0)

sudo apt-get install curl 对于Node.js v4

curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - sudo apt-get install -y nodejs 或者,对于Node.js v5:

curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash - sudo apt-get install -y nodejs