这个环境真的是伤不起了。。。。

老师说要培养全栈工程师,我真的佩服的五体投地啊。。。。css都可以一边做网站一边写,昨天搞sass搞通了,今天用Homestead以后又是各种花式报错。。。

yarn install v1.10.1
info No lockfile found.
[1/4] Resolving packages...
warning laravel-mix > autoprefixer > browserslist@2.11.3: Browserslist 2 could fail on reading Br
owserslist >3.0 config used in other tools.
warning laravel-mix > css-loader > cssnano > autoprefixer > browserslist@1.7.7: Browserslist 2 co
uld fail on reading Browserslist >3.0 config used in other tools.
warning laravel-mix > css-loader > cssnano > postcss-merge-rules > browserslist@1.7.7: Browsersli
st 2 could fail on reading Browserslist >3.0 config used in other tools.
warning laravel-mix > css-loader > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7
.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from
 installation.
[3/4] Linking dependencies...
warning "laravel-mix > img-loader@3.0.1" has unmet peer dependency "imagemin@^5.0.0 || ^6.0.0".
[4/4] Building fresh packages...
[-/2] ⠁ waiting...
error D:\HomeSteadCode\sample03\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: D:\HomeSteadCode\sample03\node_modules\node-sass
Output:
Building: C:\Users\wongvio\scoop\apps\nodejs\current\node.exe D:\HomeSteadCode\sample03\node_modu
les\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:\\Users\\wongvio\\scoop\\apps\\nodejs\\current\\node.exe',
gyp verb cli   'D:\\HomeSteadCode\\sample03\\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@10.12.0 | 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 (D:\HomeSteadCode\sample03\node_modules\which\whi
ch.js:13:12)
gyp verb `which` failed     at F (D:\HomeSteadCode\sample03\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\HomeSteadCode\sample03\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\HomeSteadCode\sample03\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\HomeSteadCode\sample03\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\HomeSteadCode\sample03\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (D:\HomeSteadCode\sample03\node_modules\which\whi
ch.js:13:12)
gyp verb `which` failed     at F (D:\HomeSteadCode\sample03\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\HomeSteadCode\sample03\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\HomeSteadCode\sample03\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\HomeSteadCode\sample03\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\HomeSteadCode\sample03\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:154:21)
gyp verb `which` failed   stack:
gyp verb `which` failed    'Error: not found: python2\n    at getNotFoundError (D:\\HomeSteadCode
\\sample03\\node_modules\\which\\which.js:13:12)\n    at F (D:\\HomeSteadCode\\sample03\\node_mod
ules\\which\\which.js:68:19)\n    at E (D:\\HomeSteadCode\\sample03\\node_modules\\which\\which.j
s:80:29)\n    at D:\\HomeSteadCode\\sample03\\node_modules\\which\\which.js:89:16\n    at D:\\Hom
eSteadCode\\sample03\\node_modules\\isexe\\index.js:42:5\n    at D:\\HomeSteadCode\\sample03\\nod
e_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:154:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Users\wongvio\AppData\Local\Programs\Python\Python37\python.
EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\wongvio\AppData\Local\Programs\Python\Python37\pyt
hon.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:289:12)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:962:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Users\\wongvio\\scoop\\apps\\nodejs\\current\\node.exe" "D:\\HomeSteadCode\
\sample03\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--li
bsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\HomeSteadCode\sample03\node_modules\node-sass
gyp ERR! node -v v10.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
讨论数量: 4
Echos

实在不行可以试试laragon或者别的,跟教程环境一样只是方便你学习,毕竟如果每个人环境不统一的话报的错也不同,当然前提是你有能力解决环境报错问题

5年前 评论

@Echos 待我休息一下,来解决这些问题

5年前 评论
Echos

@wongvio 欧克

5年前 评论
  1. 首先打开项目根目录下package.json文件
  2. scripts下的所有cross-env删除掉,(其他地方不要动
    处理结果代码如下(可以直接复制我的这段代码来覆盖你的的代码):
    {
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "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": "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",
        "bootstrap-sass": "^3.3.7",
        "cross-env": "^5.1",
        "jquery": "^3.2",
        "laravel-mix": "^1.0",
        "lodash": "^4.17.4",
        "vue": "^2.5.7"
    }
    }
  3. 执行一下yarn install –no-bin-links ,注意强烈建议再你的蓝灯(或其他代理软件上)开启全局代理模式,否则会失败
  4. 最后执行编译命令:npm run dev 或者 npm run watch-poll
    真心希望能帮到你!!!
5年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!