(之前已安装好node.js与thinkjs)
1.安装前复查node.js及thinjs的版本
检查node.js版本:
node -v
检查thinkjs版本:
thinkjs -V
2.创建thinkjs项目
C:\Users\宛\Desktop>cd stu/
C:\Users\宛\Desktop\stu>thinkjs new demo
执行过程中会要求我们输入项目名称、项目简介、作者、是否开启 babel 转译,结果如下:
? Project name study
? Project description application created by thinkjs
? Author wan
? Do you want to turn on babel? No
由于我的node.js的版本号大于8.0,因此我选择了不转译
之后安装依赖:(项目下的package.json就是它的依赖)
npm install
这里出现了一堆警告,但我没有当回事儿:
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\宛\Desktop\stu\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\宛\Desktop\stu\package.json'
npm WARN stu No description
npm WARN stu No repository field.
npm WARN stu No README data
npm WARN stu No license field.
启动项目:
npm start
但是这里报错了:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\宛\Desktop\stu\package.json
npm ERR