Изменения не отражаются в Vue Js

#laravel #vue.js #npm

#laravel #vue.js #npm

Вопрос:

Я использую Laravel в качестве серверной части и Vue JS во внешнем интерфейсе. Когда я пытаюсь запустить команду npm install, я получаю эту ошибку,

     npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14 . Upgrade to chokidar 3 with 15x less dependencies.

> node-sass@4.11.0 install C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_modulesnode-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.11.0/win32-x64-72_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.11.0/win32-x64-72_binding.node":

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> uglifyjs-webpack-plugin@0.4.6 postinstall C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_moduleslaravel-mixnode_moduleswebpacknode_modulesuglifyjs-webpack-plugin
> node lib/post_install.js


> node-sass@4.11.0 postinstall C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_modulesnode-sass
> node scripts/build.js

Building: C:Program Filesnodejsnode.exe C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_modulesnode-gypbinnode-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   'C:\Program Files\nodejs\node.exe',
gyp verb cli   'C:\xampp\htdocs\dreamlogic\dalal-spare-parts-dreamlogic\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.14.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 "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_moduleswhichwhich.js:13:12)
gyp verb `which` failed     at F (C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_moduleswhichwhich.js:68:19)
gyp verb `which` failed     at E (C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_moduleswhichwhich.js:80:29)
gyp verb `which` failed     at C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_moduleswhichwhich.js:89:16
gyp verb `which` failed     at C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_modulesisexeindex.js:42:5
gyp verb `which` failed     at C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_modulesisexewindows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_moduleswhichwhich.js:13:12)
gyp verb `which` failed     at F (C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_moduleswhichwhich.js:68:19)
gyp verb `which` failed     at E (C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_moduleswhichwhich.js:80:29)
gyp verb `which` failed     at C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_moduleswhichwhich.js:89:16
gyp verb `which` failed     at C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_modulesisexeindex.js:42:5
gyp verb `which` failed     at C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_modulesisexewindows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21) {
gyp verb `which` failed   stack: 'Error: not found: python2n'  
gyp verb `which` failed     '    at getNotFoundError (C:\xampp\htdocs\dreamlogic\dalal-spare-parts-dreamlogic\node_modules\which\which.js:13:12)n'  
gyp verb `which` failed     '    at F (C:\xampp\htdocs\dreamlogic\dalal-spare-parts-dreamlogic\node_modules\which\which.js:68:19)n'  
gyp verb `which` failed     '    at E (C:\xampp\htdocs\dreamlogic\dalal-spare-parts-dreamlogic\node_modules\which\which.js:80:29)n'  
gyp verb `which` failed     '    at C:\xampp\htdocs\dreamlogic\dalal-spare-parts-dreamlogic\node_modules\which\which.js:89:16n'  
gyp verb `which` failed     '    at C:\xampp\htdocs\dreamlogic\dalal-spare-parts-dreamlogic\node_modules\isexe\index.js:42:5n'  
gyp verb `which` failed     '    at C:\xampp\htdocs\dreamlogic\dalal-spare-parts-dreamlogic\node_modules\isexe\windows.js:36:5n'  
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:158: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 C:UsersRhugveda DesaiAnaconda3python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:UsersRhugveda DesaiAnaconda3python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:295:12)
gyp ERR! stack     at ChildProcess.emit (events.js:223:5)
gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\xampp\htdocs\dreamlogic\dalal-spare-parts-dreamlogic\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:xampphtdocsdreamlogicdalal-spare-parts-dreamlogicnode_modulesnode-sass
gyp ERR! node -v v12.14.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@~2.3.1 (node_moduleslaravel-mixnode_moduleswatchpacknode_moduleschokidarnode_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN ajv-keywords@3.3.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN babel-loader@7.1.5 requires a peer of webpack@2 || 3 || 4 but none is installed. You must install peer dependencies yourself.
npm WARN extract-text-webpack-plugin@3.0.2 requires a peer of webpack@^3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN friendly-errors-webpack-plugin@1.7.0 requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@6.0.7 requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN uglifyjs-webpack-plugin@1.3.0 requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-middleware@1.12.2 requires a peer of webpack@^1.0.0 || ^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-server@2.11.3 requires a peer of webpack@^2.2.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modulesfsevents):
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:UsersusernameAppDataRoamingnpm-cache_logs2021-01-18T17_51_07_932Z-debug.log
 

Мой package.json

 {
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.17",
        "babel-preset-stage-2": "^6.24.1",
        "bootstrap-sass": "^3.3.7",
        "cross-env": "^5.1",
        "jquery": "^3.2",
        "laravel-mix": "^1.0",
        "lodash": "^4.17.4",
        "material-design-icons-iconfont": "^4.0.5",
        "vue": "^2.5.7"
    },
    "dependencies": {
        "@ckeditor/ckeditor5-build-classic": "^12.0.0",
        "moment": "^2.24.0",
        "vue-ckeditor5": "^0.4.1",
        "vue-full-calendar": "^2.7.0",
        "vue-native-notification": "^1.0.5",
        "vue-router": "^3.0.2",
        "vuetify": "^1.5.4"
    }
}
 

Я попытался вставить какую-нибудь консоль.инструкции журнала в файле компонента. Но они не регистрируются в conosole. Также не работает функция оповещения. В чем может быть причина? Я новичок в этой технологии. Пожалуйста, предложите какое-нибудь решение.

Ответ №1:

Версия node-sass@4.11.0 является бета-версией и, похоже, имеет проблемы с GitHub.

Попробуйте выполнить обновление до "node-sass": "^5.0.0" вашего package.json , а затем повторно запустите команду npm install . Если это не сработает, пожалуйста, вставьте туда весь ваш файл package.json.

Комментарии:

1. Привет, спасибо за комментарий! Пожалуйста, проверьте мой package.json. @alexis-r

2. Привет @RhugvedaDesai для меня ваш package.json работает отлично. Добавлено 1565 пакетов за 33.691 сек. Поэтому, если в данный момент это не работает, просто удалите свои «модули узлов» и файл «package-lock.json», а затем повторите попытку «установки npm».