我最近格式化了Mac,但无法启动ionic框架:
首先我安装了git,然后安装了nodejs(推荐版本)。
然后我启动了这两个终端命令:
sudo npm install -g cordova
sudo npm install -g ionic
现在,当我通过以下命令行创建新项目时:
ionic启动myApp标签
我在终端中收到以下文本:
> npm i
> fsevents@1.2.9 install /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/fsevents
> node install
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for fsevents@1.2.9 and node@12.6.0 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/fsevents/lib'
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/fsevents/build'
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node" "--module_name=fse" "--module_path=/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/fsevents
gyp ERR! node -v v12.6.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:203:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
node-pre-gyp ERR! System Darwin 18.6.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/fsevents
node-pre-gyp ERR! node -v v12.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64/fse.node --module_name=fse --module_path=/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/fsevents/lib/binding/Release/node-v72-darwin-x64 --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
> node-sass@4.12.0 install /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/node-sass
> node scripts/install.js
Unable to save binary /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/node-sass/vendor/darwin-x64-72 : Error: EACCES: permission denied, mkdir '/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/node-sass/vendor'
at Object.mkdirSync (fs.js:764:3)
at sync (/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/mkdirp/index.js:71:13)
at Function.sync (/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/node-sass/scripts/install.js:114:11)
at Object.<anonymous> (/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/node-sass/scripts/install.js:157:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:839:10) {
errno: -13,
syscall: 'mkdir',
code: 'EACCES',
path: '/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/node-sass/vendor'
}
> core-js@2.6.9 postinstall /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/core-js
> node scripts/postinstall || echo "ignore"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> node-sass@4.12.0 postinstall /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/node-sass
> node scripts/build.js
Building: /usr/local/bin/node /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli '/usr/local/bin/node',
gyp verb cli '/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@12.6.0 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/which/which.js:80:29)
gyp verb `which` failed at /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/which/which.js:89:16
gyp verb `which` failed at /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:165:21)
gyp verb `which` failed python2 Error: not found: python2
gyp verb `which` failed at getNotFoundError (/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/which/which.js:80:29)
gyp verb `which` failed at /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/which/which.js:89:16
gyp verb `which` failed at /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:165:21) {
gyp verb `which` failed stack: 'Error: not found: python2\n' +
gyp verb `which` failed ' at getNotFoundError (/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/which/which.js:13:12)\n' +
gyp verb `which` failed ' at F (/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/which/which.js:68:19)\n' +
gyp verb `which` failed ' at E (/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/which/which.js:80:29)\n' +
gyp verb `which` failed ' at /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/which/which.js:89:16\n' +
gyp verb `which` failed ' at /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/isexe/index.js:42:5\n' +
gyp verb `which` failed ' at /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/isexe/mode.js:8:5\n' +
gyp verb `which` failed ' at FSReqCallback.oncomplete (fs.js:165:21)',
gyp verb `which` failed code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python /usr/bin/python
gyp verb check python version `/usr/bin/python -c "import sys; print "2.7.10
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 12.6.0
gyp verb command install [ '12.6.0' ]
gyp verb install input version string "12.6.0"
gyp verb install installing version: 12.6.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 12.6.0
gyp verb build dir attempting to create "build" dir: /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/node-sass/build'
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/bin/node" "/Users/carlolomello/Desktop/ionicApp/testApp/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/carlolomello/Desktop/ionicApp/testApp/node_modules/node-sass
gyp ERR! node -v v12.6.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.12.0 (node_modules/node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.12.0 postinstall: `node scripts/build.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
added 1062 packages from 1037 contributors and audited 54002 packages in 53.791s
found 0 vulnerabilities
> git init
Initialized empty Git repository in /Users/carlolomello/Desktop/ionicApp/testApp/.git/
> git add -A
> git commit -m "Initial commit" --no-gpg-sign
[master (root-commit) a06363b] Initial commit
53 files changed, 12071 insertions(+)
create mode 100644 .gitignore
create mode 100644 angular.json
create mode 100644 e2e/protractor.conf.js
create mode 100644 e2e/src/app.e2e-spec.ts
create mode 100644 e2e/src/app.po.ts
create mode 100644 e2e/tsconfig.e2e.json
create mode 100644 ionic.config.json
create mode 100644 package-lock.json
create mode 100644 package.json
create mode 100644 src/app/app-routing.module.ts
create mode 100644 src/app/app.component.html
create mode 100644 src/app/app.component.spec.ts
create mode 100644 src/app/app.component.ts
create mode 100644 src/app/app.module.ts
create mode 100644 src/app/app.scss
create mode 100644 src/app/tab1/tab1.module.ts
create mode 100644 src/app/tab1/tab1.page.html
create mode 100644 src/app/tab1/tab1.page.scss
create mode 100644 src/app/tab1/tab1.page.spec.ts
create mode 100644 src/app/tab1/tab1.page.ts
create mode 100644 src/app/tab2/tab2.module.ts
create mode 100644 src/app/tab2/tab2.page.html
create mode 100644 src/app/tab2/tab2.page.scss
create mode 100644 src/app/tab2/tab2.page.spec.ts
create mode 100644 src/app/tab2/tab2.page.ts
create mode 100644 src/app/tab3/tab3.module.ts
create mode 100644 src/app/tab3/tab3.page.html
create mode 100644 src/app/tab3/tab3.page.scss
create mode 100644 src/app/tab3/tab3.page.spec.ts
create mode 100644 src/app/tab3/tab3.page.ts
create mode 100644 src/app/tabs/tabs.module.ts
create mode 100644 src/app/tabs/tabs.page.html
create mode 100644 src/app/tabs/tabs.page.scss
create mode 100644 src/app/tabs/tabs.page.spec.ts
create mode 100644 src/app/tabs/tabs.page.ts
create mode 100644 src/app/tabs/tabs.router.module.ts
create mode 100644 src/assets/icon/favicon.png
create mode 100644 src/assets/shapes.svg
create mode 100644 src/environments/environment.prod.ts
create mode 100644 src/environments/environment.ts
create mode 100644 src/global.scss
create mode 100644 src/index.html
create mode 100644 src/karma.conf.js
create mode 100644 src/main.ts
create mode 100644 src/polyfills.ts
create mode 100644 src/test.ts
create mode 100644 src/theme/variables.scss
create mode 100644 src/tsconfig.app.json
create mode 100644 src/tsconfig.spec.json
create mode 100644 src/tslint.json
create mode 100644 src/zone-flags.ts
create mode 100644 tsconfig.json
create mode 100644 tslint.json
[INFO] Next Steps:
- Go to your newly created project: cd ./testApp
- Run ionic serve within the app directory to see your app
- Build features and components: https://ion.link/scaffolding-docs
- Get Ionic DevApp for easy device testing: https://ion.link/devapp
遇到过同样问题的人能告诉我他如何解决吗?
预先感谢