TEAMMATES / teammates

This is the project website for the TEAMMATES feedback management tool for education
https://teammatesv4.appspot.com/
GNU General Public License v2.0
1.66k stars 3.31k forks source link

npm run lint not running locally #7508

Closed HirdayGupta closed 7 years ago

HirdayGupta commented 7 years ago

When I try to run the npm run lint command on my local machine, the build fails with the message lintspaces: command not found Below is the complete output from Terminal:

lintspaces -n -t -d spaces -l 1 -. "src/**/*.jsp" "src/**/*.tag" "src/main/**/*.html" "src/**/*.xml" "src/**/*.json" "src/**/*.css" "src/**/*.java" "src/**/*.es6" "src/**/*.properties" "*.yml" "*.gradle" "static-analysis/*.*ml"

sh: lintspaces: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @ lint:spaces: `lintspaces -n -t -d spaces -l 1 -. "src/**/*.jsp" "src/**/*.tag" "src/main/**/*.html" "src/**/*.xml" "src/**/*.json" "src/**/*.css" "src/**/*.java" "src/**/*.es6" "src/**/*.properties" "*.yml" "*.gradle" "static-analysis/*.*ml"`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the @ lint:spaces 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!     /Users/HirdayGupta/.npm/_logs/2017-06-12T17_31_53_351Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ lint: `npm run lint:src && npm run lint:test && npm run lint:json && npm run lint:css && npm run lint:spaces`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ lint 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!     /Users/HirdayGupta/.npm/_logs/2017-06-12T17_31_53_374Z-debug.log

The first log output (/Users/HirdayGupta/.npm/_logs/2017-06-12T17_31_53_351Z-debug.log) can be found here.

The second log output (/Users/HirdayGupta/.npm/_logs/2017-06-12T17_31_53_374Z-debug.log) can be found here.

Operating System: MacOS Sierra (10.12.5) Branch: Master (Merged with most recent commit on Teammates/Master)

VamsiSangam commented 7 years ago

lintspaces is newly added. I think you must run npm install to get it.

HirdayGupta commented 7 years ago

@VamsiSangam Thanks! That worked. Now it's giving me the same trivial errors (descirbed below) as you posted on Slack 😝.

The following config files are being checked by the npm run lint command and throwing unexpected trailing/leading space errors and/or expected newline and unexpected additional newlines at end of file errors.

However, as the scope of this issue has been resolved, closing this issue.

VamsiSangam commented 7 years ago

Cool :+1: .. Those issues don't seem to matter. The Travis CI build on GitHub will pass even with those errors displayed in local CLI :smile:

davel37 commented 7 years ago

I'm having a similar problem to this at the moment and I'm not having much luck with Google or Stackoverflow. I've installed lintspaces as recommended above but I'm still getting the following errors:

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ lint:spaces: lintspaces -n -t -d spaces -l 1 -. "src/**/*.jsp" "src/**/*.tag" "src/main/**/*.html" "src/**/*.xml" "src/**/*.json" "src/**/*.css" "src/**/*.java" "src/**/*.es6" "src/**/*.properties" "*.yml" "*.gradle" "static-analysis/*.*ml" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ lint:spaces 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\ACER\AppData\Roaming\npm-cache_logs\2017-07-10T22_05_09_974Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ lint: npm run lint:js && npm run lint:json && npm run lint:css && npm run lint:spaces npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ lint script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

My Log File:

0 info it worked if it ends with ok 1 verbose cli [ 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Users\ACER\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'lint' ] 2 info using npm@5.1.0 3 info using node@v6.11.0 4 verbose run-script [ 'prelint', 'lint', 'postlint' ] 5 info lifecycle @~prelint: @ 6 info lifecycle @~lint: @ 7 verbose lifecycle @~lint: unsafe-perm in lifecycle true 8 verbose lifecycle @~lint: PATH: C:\Users\ACER\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\Users\ACER\Documents\teammates\node_modules.bin;C:\Users\ACER\bin;C:\Users\ACER\AppData\Local\Atlassian\SourceTree\git_local\mingw32\bin;C:\Users\ACER\AppData\Local\Atlassian\SourceTree\git_local\usr\local\bin;C:\Users\ACER\AppData\Local\Atlassian\SourceTree\git_local\usr\bin;C:\Users\ACER\AppData\Local\Atlassian\SourceTree\git_local\usr\bin;C:\Users\ACER\AppData\Local\Atlassian\SourceTree\git_local\mingw32\bin;C:\Users\ACER\AppData\Local\Atlassian\SourceTree\git_local\usr\bin;C:\Users\ACER\bin;C:\Users\ACER\AppData\Local\SourceTree\app-2.1.2.5\NativeBinaries\amd64;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Skype\Phone;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn;C:\Program Files\Microsoft SQL Server\100\Tools\Binn;C:\Program Files\Microsoft SQL Server\100\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn;C:\Program Files\nodejs;C:\Users\ACER\AppData\Local\Microsoft\WindowsApps;C:\Users\ACER\AppData\Roaming\npm;C:\Users\ACER\AppData\Local\Atlassian\SourceTree\git_local\usr\bin\vendor_perl;C:\Users\ACER\AppData\Local\Atlassian\SourceTree\git_local\usr\bin\core_perl 9 verbose lifecycle @~lint: CWD: C:\Users\ACER\Documents\teammates 10 silly lifecycle @~lint: Args: [ '/d /s /c', 10 silly lifecycle 'npm run lint:js && npm run lint:json && npm run lint:css && npm run lint:spaces' ] 11 silly lifecycle @~lint: Returned: code: 1 signal: null 12 info lifecycle @~lint: Failed to exec lint script 13 verbose stack Error: @ lint: npm run lint:js && npm run lint:json && npm run lint:css && npm run lint:spaces 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (C:\Users\ACER\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:289:16) 13 verbose stack at emitTwo (events.js:106:13) 13 verbose stack at EventEmitter.emit (events.js:191:7) 13 verbose stack at ChildProcess. (C:\Users\ACER\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14) 13 verbose stack at emitTwo (events.js:106:13) 13 verbose stack at ChildProcess.emit (events.js:191:7) 13 verbose stack at maybeClose (internal/child_process.js:891:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 14 verbose pkgid @ 15 verbose cwd C:\Users\ACER\Documents\teammates 16 verbose Windows_NT 10.0.14393 17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\ACER\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "lint" 18 verbose node v6.11.0 19 verbose npm v5.1.0 20 error code ELIFECYCLE 21 error errno 1 22 error @ lint: npm run lint:js && npm run lint:json && npm run lint:css && npm run lint:spaces 22 error Exit status 1 23 error Failed at the @ lint script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

Windows 10 Pro. npm 5.1.0 node 6.11.0

whipermr5 commented 7 years ago

@davel37 Did npm install complete successfully?

davel37 commented 7 years ago

Hi! Yes I think so, with some warnings:

npm install npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 115 packages in 93.914s

whipermr5 commented 7 years ago

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

There should be additional logging above that shows which files are failing the lint (due to trailing spaces, tabs, etc.)