Проблемы несовместимости узлов JS и SASS в проекте Ionic 3 - PullRequest
0 голосов
/ 19 мая 2019

Я пытаюсь перестроить проект Ionic 3.9.2, который был закодирован на другой машине, и я построил новый проект Ionic и перенес на него «чужие» файлы проекта.Но я получаю сообщение об ошибке, касающееся настроек SASS, когда я запускаю ionic serve -l в терминале для визуализации проекта, как показано на рисунке:

enter image description here

Чтобы это исправить, я удалил 64-битную версию Node JS 6.11.1 и установил 32-битную версию.Но теперь я получаю новые ошибки на терминале при попытке построить проект:

Сначала я получил:

Ошибка: отсутствует привязка C: \ crepe \ node_modules \ node-sass\ vendor \ win32-ia32-48 \ binding.node Узлу Sass не удалось найти привязку для вашей текущей среды: 32-разрядная ОС Windows с Node.js 6.x Обнаружена привязка для следующих сред: - 64-разрядная ОС Windows с узлом.js 6.x Обычно это происходит из-за того, что ваша среда изменилась после запуска npm install.Запустите npm rebuild node-sass --force, чтобы создать привязку для вашей текущей среды.

Итак, я выполнил указанную команду: npm rebuild node-sass --force

Но теперь я получаю целую кучу новых ошибок:

node-sass@4.5.3 install C: \ crepe \ node_modules \ node-sass node scripts / install.js Загрузка двоичного файла из https://github.com/sass/node-sass/releases/download/v4.5.3/win32-ia32-48_binding.node Загрузка завершена] -: двоичный файл сохраненC: \ crepe \ node_modules \ node-sass \ vendor \ win32-ia32-48 \ binding.node Кэширование двоичного файла в C: \ Users \ Пользователь \ AppData \ Roaming \ npm-cache \ node-sass \ 4.5.3 \ win32-ia32-48_binding.node

node-sass@4.5.3 postinstall C: \ crepe \ node_modules \ node-sass node scripts / build.js Сборка: C: \ Program Files (x86) \ nodejs \ node.exe C: \ crepe \ node_modules \ node-gyp \ bin \ node-gyp.js перестроить --verbose --libsass_ext = --libsass_cflags = --libsass_ldflags = --libsass_library =

gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files (x86)\\nodejs\\node.exe',
gyp verb cli   'C:\\crepe\\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@6.11.1 | win32 | ia32
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 (C:\crepe\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\crepe\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\crepe\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\crepe\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\crepe\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\crepe\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\crepe\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\crepe\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\crepe\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\crepe\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\crepe\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\crepe\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb `which` failed   stack: 'Error: not found: python2\n    at getNotFoundError (C:\\crepe\\node_modules\\which\\which.js:13:12)\n    at F (C:\\crepe\\node_modules\\which\\which.js:68:19)\n    at E (C:\\crepe\\node_modules\\which\\which.js:80:29)\n    at C:\\crepe\\node_modules\\which\\which.js:89:16\n    at C:\\crepe\\node_modules\\isexe\\index.js:42:5\n    at C:\\crepe\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:123:15)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\crepe\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\crepe\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\crepe\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\crepe\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\crepe\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\crepe\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb `which` failed  python { Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\crepe\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\crepe\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\crepe\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\crepe\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\crepe\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\crepe\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15)


gyp verb `which` failed     at getNotFoundError (C:\crepe\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\crepe\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\crepe\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\crepe\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\crepe\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\crepe\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb `which` failed   stack: 'Error: not found: python2\n    at getNotFoundError (C:\\crepe\\node_modules\\which\\which.js:13:12)\n    at F (C:\\crepe\\node_modules\\which\\which.js:68:19)\n    at E (C:\\crepe\\node_modules\\which\\which.js:80:29)\n    at C:\\crepe\\node_modules\\which\\which.js:89:16\n    at C:\\crepe\\node_modules\\isexe\\index.js:42:5\n    at C:\\crepe\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:123:15)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\crepe\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\crepe\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\crepe\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\crepe\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\crepe\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\crepe\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb `which` failed  python { Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\crepe\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\crepe\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\crepe\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\crepe\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\crepe\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\crepe\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:123:15)
gyp verb `which` failed   stack: 'Error: not found: python\n    at getNotFoundError (C:\\crepe\\node_modules\\which\\which.js:13:12)\n    at F (C:\\crepe\\node_modules\\which\\which.js:68:19)\n    at E (C:\\crepe\\node_modules\\which\\which.js:80:29)\n    at C:\\crepe\\node_modules\\which\\which.js:89:16\n    at C:\\crepe\\node_modules\\isexe\\index.js:42:5\n    at C:\\crepe\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:123:15)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at Object.failNoPython (C:\crepe\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at Object.<anonymous> (C:\crepe\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at C:\crepe\node_modules\graceful-fs\polyfills.js:282:31
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\crepe\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\crepe\node_modules\node-sass
gyp ERR! node -v v6.11.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
node-sass@4.5.3 C:\crepe\node_modules\node-sass

Я использую 32-битные Ionic 3.9.2, Angular 5.0.0 и Node JS 6.11.1.Что мне делать?

1 Ответ

1 голос
/ 19 мая 2019

Согласно этой документации вы должны установить Node.js LTS ( v10.15.3 , в настоящее время) вместо v6.11.1 . И обновлять npm до

$ npm i -g npm

После обновления Node.js переустановите node_modules на локальный. Вам лучше удалить папку ex - node_modules и файл package-lock.json.

Надеюсь, это поможет.

...