Ionic-4.0.0项目配置中的错误

时间:2019-04-04 10:42:21

标签: android ios cordova ionic-framework ionic4

我正在尝试使用ionic 4.0.0科尔多瓦9.0.0 npm 5.6.0节点9.11.1创建一个ionic项目

当我创建项目并通过npm install安装依赖项时,出现以下错误。

npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.

> node-sass@4.11.0 install C:\Users\bhavisha\Desktop\DemoA\node_modules\node-sass
> node scripts/install.js

Cached binary found at C:\Users\bhavisha\AppData\Roaming\npm-cache\node-sass\4.11.0\win32-x64-59_binding.node

> uglifyjs-webpack-plugin@0.4.6 postinstall C:\Users\bhavisha\Desktop\DemoA\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js


> node-sass@4.11.0 postinstall C:\Users\bhavisha\Desktop\DemoA\node_modules\node-sass
> node scripts/build.js

Binary found at C:\Users\bhavisha\Desktop\DemoA\node_modules\node-sass\vendor\win32-x64-59\binding.node
Testing binary
Binary has a problem: Error: \\?\C:\Users\bhavisha\Desktop\DemoA\node_modules\node-sass\vendor\win32-x64-59\binding.node is not a valid Win32 application.
\\?\C:\Users\bhavisha\Desktop\DemoA\node_modules\node-sass\vendor\win32-x64-59\binding.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:683:18)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at module.exports (C:\Users\bhavisha\Desktop\DemoA\node_modules\node-sass\lib\binding.js:19:10)
    at Object.<anonymous> (C:\Users\bhavisha\Desktop\DemoA\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
Building the binary locally
Building: C:\Program Files\nodejs\node.exe C:\Users\bhavisha\Desktop\DemoA\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 [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\bhavisha\\Desktop\\DemoA\\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 info using node-gyp@3.8.0
gyp info using node@9.11.1 | win32 | 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 "C:\Users\bhavisha\AppData\Local\Programs\Python\Python37-32\python.exe" in the PATH
gyp verb `which` failed Error: not found: C:\Users\bhavisha\AppData\Local\Programs\Python\Python37-32\python.exe
gyp verb `which` failed     at getNotFoundError (C:\Users\bhavisha\Desktop\DemoA\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\bhavisha\Desktop\DemoA\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\bhavisha\Desktop\DemoA\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\bhavisha\Desktop\DemoA\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\bhavisha\Desktop\DemoA\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\bhavisha\Desktop\DemoA\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:170:21)
gyp verb `which` failed  C:\Users\bhavisha\AppData\Local\Programs\Python\Python37-32\python.exe { Error: not found: C:\Users\bhavisha\AppData\Local\Programs\Python\Python37-32\python.exe
gyp verb `which` failed     at getNotFoundError (C:\Users\bhavisha\Desktop\DemoA\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\bhavisha\Desktop\DemoA\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\bhavisha\Desktop\DemoA\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\bhavisha\Desktop\DemoA\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\bhavisha\Desktop\DemoA\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\bhavisha\Desktop\DemoA\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:170:21)
gyp verb `which` failed   stack: 'Error: not found: C:\\Users\\bhavisha\\AppData\\Local\\Programs\\Python\\Python37-32\\python.exe\n    at getNotFoundError (C:\\Users\\bhavisha\\Desktop\\DemoA\\node_modules\\which\\which.js:13:12)\n    at F (C:\\Users\\bhavisha\\Desktop\\DemoA\\node_modules\\which\\which.js:68:19)\n    at E (C:\\Users\\bhavisha\\Desktop\\DemoA\\node_modules\\which\\which.js:80:29)\n    at C:\\Users\\bhavisha\\Desktop\\DemoA\\node_modules\\which\\which.js:89:16\n    at C:\\Users\\bhavisha\\Desktop\\DemoA\\node_modules\\isexe\\index.js:42:5\n    at C:\\Users\\bhavisha\\Desktop\\DemoA\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:170:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb could not find "C:\Users\bhavisha\AppData\Local\Programs\Python\Python37-32\python.exe". checking python launcher
gyp verb check python launcher python executable found: "C:\\Python27\\python.exe"
gyp verb check python version `C:\Python27\python.exe -c "import sys; print "2.7.16
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: 9.11.1
gyp verb command install [ '9.11.1' ]
gyp verb install input version string "9.11.1"
gyp verb install installing version: 9.11.1
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" 0
gyp verb needs "installVersion" 9
gyp verb install version is no good; reinstalling
gyp verb ensuring nodedir is created C:\Users\bhavisha\.node-gyp\9.11.1
gyp http GET https://nodejs.org/download/release/v9.11.1/node-v9.11.1-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v9.11.1/node-v9.11.1-headers.tar.gz
gyp verb extracted file from tarball include\node\android-ifaddrs.h
gyp verb extracted file from tarball include\node\common.gypi
gyp verb extracted file from tarball include\node\config.gypi
gyp verb extracted file from tarball include\node\node.h
gyp verb extracted file from tarball include\node\node_api.h
gyp verb extracted file from tarball include\node\node_api_types.h
gyp verb extracted file from tarball include\node\node_buffer.h
gyp verb extracted file from tarball include\node\node_object_wrap.h
gyp verb extracted file from tarball include\node\node_version.h
gyp verb extracted file from tarball include\node\pthread-barrier.h
gyp verb extracted file from tarball include\node\stdint-msvc2008.h
gyp verb extracted file from tarball include\node\tree.h
gyp verb extracted file from tarball include\node\uv-aix.h
gyp verb extracted file from tarball include\node\uv-bsd.h
gyp verb extracted file from tarball include\node\uv-darwin.h
gyp verb extracted file from tarball include\node\uv-errno.h
gyp verb extracted file from tarball include\node\uv-linux.h
gyp verb extracted file from tarball include\node\uv-os390.h
gyp verb extracted file from tarball include\node\uv-posix.h
gyp verb extracted file from tarball include\node\uv-sunos.h
gyp verb extracted file from tarball include\node\uv-threadpool.h
gyp verb extracted file from tarball include\node\uv-unix.h
gyp verb extracted file from tarball include\node\uv-version.h
gyp verb extracted file from tarball include\node\uv-win.h
gyp verb extracted file from tarball include\node\uv.h
gyp verb extracted file from tarball include\node\v8-debug.h
gyp verb extracted file from tarball include\node\v8-inspector-protocol.h
gyp verb extracted file from tarball include\node\v8-inspector.h
gyp verb extracted file from tarball include\node\v8-platform.h
gyp verb extracted file from tarball include\node\v8-profiler.h
gyp verb extracted file from tarball include\node\v8-testing.h
gyp verb extracted file from tarball include\node\v8-util.h
gyp verb extracted file from tarball include\node\v8-value-serializer-version.h
gyp verb extracted file from tarball include\node\v8-version-string.h
gyp verb extracted file from tarball include\node\v8-version.h
gyp verb extracted file from tarball include\node\v8.h
gyp verb extracted file from tarball include\node\v8config.h
gyp verb extracted file from tarball include\node\zconf.h
gyp verb extracted file from tarball include\node\zlib.h
gyp verb content checksum node-v9.11.1-headers.tar.gz 4d8e01ec5f5ded8d9a3261bc7216a21dd5d365ab92c75c63908e0ecb87c1b879
gyp WARN install got an error, rolling back install
gyp verb command remove [ '9.11.1' ]
gyp verb remove using node-gyp dir: C:\Users\bhavisha\.node-gyp
gyp verb remove removing target version: 9.11.1
gyp verb remove removing development files for version: 9.11.1
gyp ERR! configure error
gyp ERR! stack Error: unexpected end of file
gyp ERR! stack     at Zlib.zlibOnError [as onerror] (zlib.js:142:17)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\bhavisha\\Desktop\\DemoA\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\bhavisha\Desktop\DemoA\node_modules\node-sass
gyp ERR! node -v v9.11.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.11.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.11.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\bhavisha\AppData\Roaming\npm-cache\_logs\2019-04-04T10_18_45_944Z-debug.log

C:\Users\bhavisha\Desktop\DemoA>ionic serve
> ionic-app-scripts serve --address 0.0.0.0 --port 8101 --livereload-port 35730 --dev-logger-port 53704 --nobrowser
[app-scripts] internal/modules/cjs/loader.js:550
[app-scripts]     throw err;
[app-scripts]     ^
[app-scripts]
[app-scripts] Error: Cannot find module 'C:\Users\bhavisha\Desktop\DemoA\node_modules\@ionic\app-scripts\bin\ionic-app-scripts.js'
[app-scripts]     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
[app-scripts]     at Function.Module._load (internal/modules/cjs/loader.js:475:25)
[app-scripts]     at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
[app-scripts]     at startup (internal/bootstrap/node.js:201:19)
[app-scripts]     at bootstrapNodeJSCore (internal/bootstrap/node.js:516:3)

[ERROR] A utility CLI has unexpectedly closed.

        The Ionic CLI will exit. Please check any output above for error details.

我尝试安装应用程序脚本并尝试了不同的ionic,cordova,npm,节点版本。但我无法解决问题。

0 个答案:

没有答案