I have given a project which works ok on other PCs but on mine it doesnt work.
When I hit build, it reports in node logs error missing script: build
Steps that I've done
installed nodejs
installed gulp globally and locally (inside of mvc project)
*Warning: I have different versions of nodejs and gulp then it specified in solution.
here is the package.json:
{
"name": "test",
"version": "1.0.0",
"private": true,
"scripts": {
"css": "gulp"
},
"engines": {
"node": "5.9.1",
"npm": "3.7.3"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-less": "^3.1.0",
"gulp-minify-css": "^1.2.4",
"gulp-sourcemaps": "^2.3.0",
"gulp-uglify": "^2.0.0",
"gulp-util": "^3.0.7",
"merge-stream": "^1.0.0"
}
}
so when I hit command npm run gulp it says that gulp script doesnt found - expected.
but when I hit npm run css Im gettin an error:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'css'
1 verbose cli ]
2 info using npm#6.13.1
3 info using node#v13.3.0
4 verbose run-script [ 'precss', 'css', 'postcss' ]
5 info lifecycle tiptimes#1.0.0~precss: tiptimes#1.0.0
6 info lifecycle tiptimes#1.0.0~css: tiptimes#1.0.0
7 verbose lifecycle tiptimes#1.0.0~css: unsafe-perm in lifecycle true
8 verbose lifecycle tiptimes#1.0.0~css: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Work\tiptimes\MvcApplication\node_modules\.bin;C:\Program Files\ConEmu\ConEmu\Scripts;C:\Program Files\ConEmu;C:\Program Files\ConEmu\ConEmu;C:\Program Files\Microsoft MPI\Bin\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\ProgramData\chocolatey\bin;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Git\cmd;C:\Program Files\Seq\;C:\Program Files\Seq\Client\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\nodejs\;C:\Program Files (x86)\dotnet\;C:\Users\Stefan Cvetkovic\AppData\Local\Microsoft\WindowsApps;C:\Users\Stefan Cvetkovic\.dotnet\tools;C:\Program Files (x86)\Rico Suter\NSwagStudio\;C:\Users\Stefan Cvetkovic\AppData\Roaming\npm;C:\Users\Stefan Cvetkovic\.dotnet\tools
9 verbose lifecycle tiptimes#1.0.0~css: CWD: C:\Work\tiptimes\MvcApplication
10 silly lifecycle tiptimes#1.0.0~css: Args: [ '/d /s /c', 'gulp' ]
11 silly lifecycle tiptimes#1.0.0~css: Returned: code: 1 signal: null
12 info lifecycle tiptimes#1.0.0~css: Failed to exec css script
13 verbose stack Error: tiptimes#1.0.0 css: `gulp`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:219:5)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:219:5)
13 verbose stack at maybeClose (internal/child_process.js:1027:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:285:5)
14 verbose pkgid tiptimes#1.0.0
15 verbose cwd C:\Work\tiptimes\MvcApplication
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "css"
18 verbose node v13.3.0
19 verbose npm v6.13.1
20 error code ELIFECYCLE
21 error errno 1
22 error tiptimes#1.0.0 css: `gulp`
22 error Exit status 1
23 error Failed at the tiptimes#1.0.0 css script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Here are my files in the root of MVCApp
https://i.imgur.com/QOo2OLE.png
Im using vs2017
Any help would be appreciated!
Since it works on other PC, double check their nodejs version and make sur it matches yours.
Also, you either want to run gulp directly (gulp yourGulpTask) or add node script within package.json and run them with npm. Ex (add scripts node in your package.json file):
"scripts": {
"build": "gulp build",
"test": "gulp test",
"watch": "gulp watch",
},
With the previous scripts declaration, if the the gulp task build, test and watch are define within the gulp.js file, you could run the following :
npm run build
npm run test
npm run watch
When gulp is ran without arguments, it is trying to run the default task. In your case, the css script is calling gulp without argument, therefore calling the default gulp task([ 'precss', 'css', 'postcss' ]).
To debug, make sure you can run these gulp-tasks independently
gulp precss
gulp css
gulp postcss
It feels like your precss works fine. Your css task is bugging and we never get to postcss.
The meaningfull error on your log is this one :
verbose lifecycle tiptimes#1.0.0~css: unsafe-perm in lifecycle true
Most likey confirming the nodejs version issue :: npm run test - unsafe-perm in lifecycle
On a quick note, running npm run gulp would be weird. Should always give meaningfull name to your scripts... Gulp.js conventions for tasks names
I've had a Nightwatch project running on a daily timer testing my site. I have a log file that I check every few weeks to make sure everything is going smoothly. Today I noticed it's been running, but crashing after a couple seconds of running (it usually takes half an hour to do everything).
I haven't changed the code, updated any of the packages or node, or purposefully changed anything else on my computer in the past week.
I placed a lot of logging calls in my code (I had to use my fs logger because console.log is not showing up after the process runs like it normally does). It doesn't always quit at the same point through the code, so I figured it was a Nightwatch problem and not mine.
I created a simple test file I could use to see if my complicated tests were messing things up. It prints the logs to my file, but doesn't run any of the tests and the browser pops up for less than a second before the whole thing crashes.
Current test:
const fs = require('fs');
module.exports = {
'#tags': ['getDistricts'],
'Get Districts Assert Title': function (browser) {
fs.appendFile("./log.txt", "\nBROWSER: " + JSON.stringify(browser), function (err) { });
browser.pause(100000); //prevent method from ending before tickets are retrieved
fs.appendFile("./log.txt", "\nNew run: " + new Date(), function (err) { });
browser
.url('https://www.google.com')
.waitForElementVisible('body')
.assert.title('Google')
fs.appendFile("./log.txt", "\nRan tests", function (err) { });
}
};
Log file:
BROWSER: {"capabilities":{},"globals":{"waitForConditionTimeout":15000},"sessionId":null,"options":{"screenshots":true,"screenshotsPath":"./node_modules/nightwatch/screenshots/","skip_testcases_on_fail":true,"log_screenshot_data":true,"username":"${SAUCE_USERNAME}","accessKey":"${SAUCE_ACCESS_KEY}","desiredCapabilities":{"browserName":"chrome","javascriptEnabled":true,"acceptSslCerts":true,"platform":"ANY","chromeOptions":{"args":["Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46\n (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3","--window-size=640,1136"]},"name":"Temp Test"}},"launchUrl":"http://localhost","launch_url":"http://localhost","screenshotsPath":"./node_modules/nightwatch/screenshots/","Keys":{"NULL":"","CANCEL":"","HELP":"","BACK_SPACE":"","TAB":"","CLEAR":"","RETURN":"","ENTER":"","SHIFT":"","CONTROL":"","ALT":"","PAUSE":"","ESCAPE":"","SPACE":"","PAGEUP":"","PAGEDOWN":"","END":"","HOME":"","LEFT_ARROW":"","UP_ARROW":"","RIGHT_ARROW":"","DOWN_ARROW":"","ARROW_LEFT":"","ARROW_UP":"","ARROW_RIGHT":"","ARROW_DOWN":"","INSERT":"","DELETE":"","SEMICOLON":"","EQUALS":"","NUMPAD0":"","NUMPAD1":"","NUMPAD2":"","NUMPAD3":"","NUMPAD4":"","NUMPAD5":"","NUMPAD6":"","NUMPAD7":"","NUMPAD8":"","NUMPAD9":"","MULTIPLY":"","ADD":"","SEPARATOR":"","SUBTRACT":"","DECIMAL":"","DIVIDE":"","F1":"","F2":"","F3":"","F4":"","F5":"","F6":"","F7":"","F8":"","F9":"","F10":"","F11":"","F12":"","COMMAND":"","META":""},"expect":{},"assert":{},"verify":{},"currentEnv":"tempTest_1","currentTest":{"name":"Get Districts Assert Title","module":"tempTest","results":{"steps":[],"passed":0,"failed":0,"errors":0,"skipped":0,"tests":0,"testcases":{},"timestamp":"Thu, 22 Aug 2019 18:50:31 GMT","time":0},"group":""}}
New run: Thu Aug 22 2019 13:50:31 GMT-0500 (Central Daylight Time)
Ran tests
npm test --verbose:
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'test',
npm verb cli '--verbose' ]
npm info using npm#6.9.0
npm info using node#v10.16.0
npm verb run-script [ 'pretest', 'test', 'posttest' ]
npm info lifecycle artms-nightwatch#1.0.24~pretest: artms-nightwatch#1.0.24
npm info lifecycle artms-nightwatch#1.0.24~test: artms-nightwatch#1.0.24
> artms-nightwatch#1.0.24 test C:\Users\malai\Nightwatch
> nightwatch --env local
Starting selenium server in parallel mode... started - PID: 23680
Started child process for: tempTest
>> tempTest finished.
npm verb lifecycle artms-nightwatch#1.0.24~test: unsafe-perm in lifecycle true
npm verb lifecycle artms-nightwatch#1.0.24~test: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\malai\Nightwatch\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_211\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\dotnet\;C:\Program Files (x86)\dotnet\;C:\Users\malai\AppData\Local\Microsoft\WindowsApps;C:\Users\malai\AppData\Roaming\npm;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\malai\.dotnet\tools
npm verb lifecycle artms-nightwatch#1.0.24~test: CWD: C:\Users\malai\Nightwatch
npm info lifecycle artms-nightwatch#1.0.24~test: Failed to exec test script
npm ERR! Test failed. See above for more details.
npm verb exit [ 1, true ]
npm timing npm Completed in 4145ms
npm verb code 1
I was never able to figure out why it stopped working, but I started from scratch and rebuilt the project on the most recent version of Nightwatch and copied my tests over and it's working again.
I just created a new .Net Core 2.0 Angualar project template and get a strange error on restoring the packages.
Part of the output:
npm ERR! fetch failed https://registry.npmjs.org/extend/-/extend-3.0.1.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.0.162:443
Later part of the output:
23980 error argv "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Web\\External\\Node.exe" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Web\\External\\node_modules\\npm\\bin\\npm-cli.js" "install"
23981 error node v5.4.1
23982 error npm v3.3.4
23983 error code ETIMEDOUT
23984 error errno ETIMEDOUT
23985 error syscall connect
23986 error network connect ETIMEDOUT 151.101.0.162:443
23986 error network This is most likely not a problem with npm itself
23986 error network and is related to network connectivity.
23986 error network In most cases you are behind a proxy or have bad network settings.
23986 error network
23986 error network If you are behind a proxy, please make sure that the
23986 error network 'proxy' config is set properly. See: 'npm help config'
23987 verbose exit [ 1, true ]
Most solutions I found was about setting up the proxy. I have no proxy.
I also found this answer:
npm config set proxy false
npm cache clean
Which does nothing change.
I also resetted my network adapter and pc. Also I tried ipconfig -flushdns.
tracert is also working fine:
Routenverfolgung zu a.sni.fastly.net [151.101.0.162]
über maximal 30 Hops:
1 4 ms 1 ms <1 ms 192.168.1.1
2 28 ms 28 ms 28 ms loopback0.80.rdsl.99.nue.de.net.telefonica.de [62.52.195.28]
3 34 ms 29 ms 27 ms bundle-ether3.0001.dbrx.01.nue.de.net.telefonica.de [62.53.3.154]
4 * * * Zeitüberschreitung der Anforderung.
5 34 ms 36 ms 32 ms ae14-0.0001.corx.01.fra.de.net.telefonica.de [62.53.22.86]
6 32 ms 32 ms 32 ms bundle-ether15.0002.dbrx.02.fra.de.net.telefonica.de [62.53.26.0]
7 31 ms 38 ms 36 ms ae6-0.0001.prrx.11.fra.de.net.telefonica.de [62.53.19.146]
8 31 ms 30 ms 31 ms fastly2.fra.ecix.net [62.69.146.89]
9 33 ms 31 ms 35 ms 151.101.0.162
Ablaufverfolgung beendet.
If I call https://registry.npmjs.org/extend/-/extend-3.0.1.tgz in browser, I get the package offered for download.
Any pointers?
I have no idea what is happening...
But as a workaround, I have installed the Node MSI, and configured visual studio to use this one instead.
Tools > Options > Projects & Solutions > Web Package Management > External Web Tools
Now it is working. But I feel wrong using this workaround. If anybody has some pointers, how to fix the root of the problem, I would be more than happy.
I used Visual Studio Code 0.10.2. When I tried to run task using GNU make command, the task is failed with error messages like below. My GNU make is obtained from MSYS2 x64 (http://msys2.github.io/) and my system environment is Windows 10 Education x64.
make -C 00.BootLoader
0 [main] make 24552 D:\GNU\msys64\usr\bin\make.exe: *** fatal error in forked process - fork: can't reserve memory for parent stack 0x600000 - 0x800000, (child has 0x400000 - 0x600000), Win32 error 487
192 [main] make 24552 cygwin_exception::open_stackdumpfile: Dumping stack trace to make.exe.stackdump
0 [main] make 23968 fork: child -1 - forked process 24552 died unexpectedly, retry 0, exit code 0x100, errno 11
But when I tried same command using console window (cmd.exe), "make" works successfully. How to fix this?
please help with this build problem. i have checked system variables. they are correct like priyank mentioned in other answers
Warning 1 The TypeScript Compiler was given no files for compilation, so it will skip compiling. C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets 90 5 SampleHybridApp
Error 2 Cannot find module 'config-chain' Z:\VSProject\Projects\SampleHybridApp\SampleHybridApp\EXEC 1 1 SampleHybridApp
Error 3 The command ""C:\Users\Vishal Dwivedi\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" build --platform "Android" --configuration "Debug" --projectDir . --projectName "SampleHybridApp" --buildServerUrl "" --buildTarget "AndroidEmulator"" exited with code 8. C:\Users\Vishal Dwivedi\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets 68 5 SampleHybridApp