projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.
Apache License 2.0
3.12k stars 652 forks source link

Local gulp not found in D:\home\site\wwwroot #2100

Closed sudosean closed 6 months ago

sudosean commented 8 years ago

After running npm install in the kudu powershell env multiple times, gulp never shows in my node modules. commands I've run:

npm install npm install --force npm install gulp -g npm instal gulp npm link gulp

Also, running npm install always seems to end in errors:

npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\4.2.3\\node.exe" "D:\\Program Files (x86)\\npm\\3.5.1\\node_modules\\npm\\bin\\npm-cli.js" "install" "--force"
npm ERR! node v4.2.3
npm ERR! npm  v3.5.1
npm ERR! path D:\home\site\wwwroot\node_modules\.staging\wrappy-e5193d35318260dc6219dca3e7bd3562
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename 'D:\home\site\wwwroot\node_modules\.staging\wrappy-e5193d35318260dc6219dca3e7bd3562' -> 'D:\home\site\wwwroot\node_modules\bower\node_modules\update-notifier\node_modules\latest-version\node_modules\package-json\node_modules\got\node_modules\duplexify\node_modules\end-of-stream\node_modules\once\node_modules\wrappy'
npm ERR! enoent ENOENT: no such file or directory, rename 'D:\home\site\wwwroot\node_modules\.staging\wrappy-e5193d35318260dc6219dca3e7bd3562' -> 'D:\home\site\wwwroot\node_modules\bower\node_modules\update-notifier\node_modules\latest-version\node_modules\package-json\node_modules\got\node_modules\duplexify\node_modules\end-of-stream\node_modules\once\node_modules\wrappy'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     D:\home\site\wwwroot\npm-debug.log

my package.json:

{
  "name": "PolicyUI",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "start": "node bin/www",
    "test": "node ./node_modules/karma/bin/karma start --single-run"
  },
  "description": "PolicyUI",
  "author": {
    "name": "577577",
    "email": "large_sean@bah.com"
  },
  "devDependencies": {
    "angular": "*",
    "angular-animate": "1.5.5",
    "angular-aria": "1.5.5",
    "angular-material": "^1.0.6",
    "angular-messages": "1.5.5",
    "angular-mocks": "^1.5.0",
    "angular-moment": "^1.0.0-beta.6",
    "angular-route": "1.5.5",
    "angular-sanitize": "1.5.5",
    "angular-smart-table": "*",
    "angular-ui-bootstrap": "*",
    "angular-ui-router": "*",
    "angular-ui-select": "*",
    "body-parser": "~1.8.1",
    "bootstrap": "github:twbs/bootstrap#v4-dev",
    "bootstrap-sass": "*",
    "bower": "1.7.1",
    "browser-sync": "^2.11.0",
    "chai": "^3.5.0",
    "cookie-parser": "~1.3.3",
    "debug": "~2.0.0",
    "del": "^2.2.0",
    "ejs": "2.3.4",
    "express": "~4.9.0",
    "font-awesome": "*",
    "gulp": "^3.8.11",
    "gulp-bower": "0.0.10",
    "gulp-concat": "^2.6.0",
    "gulp-livereload": "3.8.1",
    "gulp-notify": "^2.2.0",
    "gulp-ruby-sass": "*",
    "gulp-svgmin": "^1.2.2",
    "gulp-uglify": "^1.5.1",
    "gulp-useref": "^3.0.4",
    "gulp-watch": "*",
    "gulp-zip": "^3.2.0",
    "jquery": "*",
    "karma": "^0.13.22",
    "karma-chai": "^0.1.0",
    "karma-chrome-extra-launcher": "^0.1.0",
    "karma-chrome-launcher": "^0.2.2",
    "karma-ie-launcher": "^0.2.0",
    "karma-jspm": "^2.0.2",
    "karma-mocha": "^0.2.2",
    "karma-ng-html2js-preprocessor": "^0.2.1",
    "karma-phantomjs-launcher": "^1.0.0",
    "merge-stream": "1.0.0",
    "minimist": "^1.2.0",
    "mocha": "^2.4.5",
    "moment": "^2.13.0",
    "morgan": "~1.3.0",
    "serve-favicon": "~2.1.3",
    "slick-carousel": "^1.6.0",
    "stylus": "0.42.3"
  }
}

after inspecting the node modules, it seems several packages are missing as well. I've been handling a lot of the deployments manually. I sync azure with the gitlab repo, then I come into the kudu shell and run the npm install commands. I need gulp to generate a public/ file with the angular/express app.

Any help or recommendations here would be greatly appreciates.

sudosean commented 8 years ago

my node version is

WEBSITE_NODE_DEFAULT_VERSION 4.2.3

davidebbo commented 8 years ago

Can you try moving up to Node 4.4.7, which is the latest 4.x version?

sudosean commented 8 years ago

same thing

errors when running npm install gulp

npm WARN deprecated graceful-fs@3.0.8: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm ERR! Windows_NT 6.2.9200
npm ERR! argv "D:\\Program Files (x86)\\nodejs\\4.4.7\\node.exe" "D:\\Program Files (x86)\\npm\\2.15.8\\node_modules\\npm\\bin\\npm-cli.js" "install" "gulp"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! path D:\home\site\wwwroot\node_modules\gulp\node_modules\gulp-util\node_modules\dateformat\node_modules\meow\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\load-json-file\node_modules\parse-json\node_modules\error-ex\node_modules\is-arrayish\package.json.1546234537
npm ERR! code EINVAL
npm ERR! errno -4071
npm ERR! syscall rename

npm ERR! EINVAL: invalid argument, rename 'D:\home\site\wwwroot\node_modules\gulp\node_modules\gulp-util\node_modules\dateformat\node_modules\meow\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\load-json-file\node_modules\parse-json\node_modules\error-ex\node_modules\is-arrayish\package.json.1546234537' -> 'D:\home\site\wwwroot\node_modules\gulp\node_modules\gulp-util\node_modules\dateformat\node_modules\meow\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\load-json-file\node_modules\parse-json\node_modules\error-ex\node_modules\is-arrayish\package.json'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
sudosean commented 8 years ago

I actually can't run npm install now, below is what the powershell in kudu gives me:

Window title cannot be longer than 1023 characters.
PS D:\home\site\wwwroot> At line:1 char:1
+ npm install
+ ~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [], RuntimeException
    + FullyQualifiedErrorId : Argument
davidebbo commented 8 years ago

Does that latest error happen consistently if you refresh Kudu Console?

But for the previous error, problem is clear: it's exceeding the 260 char path length:

D:\home\site\wwwroot\node_modules\gulp\node_modules\gulp-util\node_modules\dateformat\node_modules\meow\node_modules\read-pkg-up\node_modules\read-pkg\node_modules\load-json-file\node_modules\parse-json\node_modules\error-ex\node_modules\is-arrayish\package.json.1546234537

has 273. npm3 avoids a number of this issue, and there is a separate App Setting you can set for npm. Specifically, set WEBSITE_NPM_DEFAULT_VERSION to 3.10.3. Noe that it's a different setting form above.

sudosean commented 8 years ago

Hi David, I updated the NPM_DEFAULT_VERSION to 3.10.3 and restart the the site, I go into the kudu shell and run npm install gulp -g


npm WARN deprecated graceful-fs@3.0.8: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
D:\local\AppData\npm\gulp -> D:\local\AppData\npm\node_modules\gulp\bin\gulp.js
D:\local\AppData\npm
`-- gulp@3.9.1 
  +-- archy@1.0.0 
  +-- chalk@1.1.3 
  | +-- ansi-styles@2.2.1 
  | +-- escape-string-regexp@1.0.5 
  | +-- has-ansi@2.0.0 
  | | `-- ansi-regex@2.0.0 
  | +-- strip-ansi@3.0.1 
  | `-- supports-color@2.0.0 
  +-- deprecated@0.0.1 
  +-- gulp-util@3.0.7 
  | +-- array-differ@1.0.0 
  | +-- array-uniq@1.0.3 
  | +-- beeper@1.1.0 
  | +-- dateformat@1.0.12 
  | | +-- get-stdin@4.0.1 
  | | `-- meow@3.7.0 
  | |   +-- camelcase-keys@2.1.0 
  | |   | `-- camelcase@2.1.1 
  | |   +-- decamelize@1.2.0 
  | |   +-- loud-rejection@1.6.0 
  | |   | +-- currently-unhandled@0.4.1 
  | |   | | `-- array-find-index@1.0.1 
  | |   | `-- signal-exit@3.0.0 
  | |   +-- map-obj@1.0.1 
  | |   +-- normalize-package-data@2.3.5 
  | |   | +-- hosted-git-info@2.1.5 
  | |   | +-- is-builtin-module@1.0.0 
  | |   | | `-- builtin-modules@1.1.1 
  | |   | `-- validate-npm-package-license@3.0.1 
  | |   |   +-- spdx-correct@1.0.2 
  | |   |   | `-- spdx-license-ids@1.2.2 
  | |   |   `-- spdx-expression-parse@1.0.2 
  | |   |     `-- spdx-exceptions@1.0.5 
  | |   +-- object-assign@4.1.0 
  | |   +-- read-pkg-up@1.0.1 
  | |   | +-- find-up@1.1.2 
  | |   | | +-- path-exists@2.1.0 
  | |   | | `-- pinkie-promise@2.0.1 
  | |   | |   `-- pinkie@2.0.4 
  | |   | `-- read-pkg@1.1.0 
  | |   |   +-- load-json-file@1.1.0 
  | |   |   | +-- graceful-fs@4.1.5 
  | |   |   | +-- parse-json@2.2.0 
  | |   |   | | `-- error-ex@1.3.0 
  | |   |   | |   `-- is-arrayish@0.2.1 
  | |   |   | +-- pify@2.3.0 
  | |   |   | `-- strip-bom@2.0.0 
  | |   |   `-- path-type@1.1.0 
  | |   +-- redent@1.0.0 
  | |   | +-- indent-string@2.1.0 
  | |   | | `-- repeating@2.0.1 
  | |   | |   `-- is-finite@1.0.1 
  | |   | |     `-- number-is-nan@1.0.0 
  | |   | `-- strip-indent@1.0.1 
  | |   `-- trim-newlines@1.0.0 
  | +-- fancy-log@1.2.0 
  | | `-- time-stamp@1.0.1 
  | +-- gulplog@1.0.0 
  | | `-- glogg@1.0.0 
  | +-- has-gulplog@0.1.0 
  | | `-- sparkles@1.0.0 
  | +-- lodash._reescape@3.0.0 
  | +-- lodash._reevaluate@3.0.0 
  | +-- lodash._reinterpolate@3.0.0 
  | +-- lodash.template@3.6.2 
  | | +-- lodash._basecopy@3.0.1 
  | | +-- lodash._basetostring@3.0.1 
  | | +-- lodash._basevalues@3.0.0 
  | | +-- lodash._isiterateecall@3.0.9 
  | | +-- lodash.escape@3.2.0 
  | | | `-- lodash._root@3.0.1 
  | | +-- lodash.keys@3.1.2 
  | | | +-- lodash._getnative@3.9.1 
  | | | +-- lodash.isarguments@3.0.9 
  | | | `-- lodash.isarray@3.0.4 
  | | +-- lodash.restparam@3.6.1 
  | | `-- lodash.templatesettings@3.1.1 
  | +-- multipipe@0.1.2 
  | | `-- duplexer2@0.0.2 
  | |   `-- readable-stream@1.1.14 
  | +-- object-assign@3.0.0 
  | +-- replace-ext@0.0.1 
  | +-- through2@2.0.1 
  | | +-- readable-stream@2.0.6 
  | | | +-- core-util-is@1.0.2 
  | | | +-- inherits@2.0.1 
  | | | +-- isarray@1.0.0 
  | | | +-- process-nextick-args@1.0.7 
  | | | +-- string_decoder@0.10.31 
  | | | `-- util-deprecate@1.0.2 
  | | `-- xtend@4.0.1 
  | `-- vinyl@0.5.3 
  |   +-- clone@1.0.2 
  |   `-- clone-stats@0.0.1 
  +-- interpret@1.0.1 
  +-- liftoff@2.3.0 
  | +-- extend@3.0.0 
  | +-- findup-sync@0.4.2 
  | | +-- detect-file@0.1.0 
  | | | `-- fs-exists-sync@0.1.0 
  | | +-- is-glob@2.0.1 
  | | | `-- is-extglob@1.0.0 
  | | +-- micromatch@2.3.11 
  | | | +-- arr-diff@2.0.0 
  | | | | `-- arr-flatten@1.0.1 
  | | | +-- array-unique@0.2.1 
  | | | +-- braces@1.8.5 
  | | | | +-- expand-range@1.8.2 
  | | | | | `-- fill-range@2.2.3 
  | | | | |   +-- is-number@2.1.0 
  | | | | |   +-- isobject@2.1.0 
  | | | | |   | `-- isarray@1.0.0 
  | | | | |   +-- randomatic@1.1.5 
  | | | | |   `-- repeat-string@1.5.4 
  | | | | +-- preserve@0.2.0 
  | | | | `-- repeat-element@1.1.2 
  | | | +-- expand-brackets@0.1.5 
  | | | | `-- is-posix-bracket@0.1.1 
  | | | +-- extglob@0.3.2 
  | | | +-- filename-regex@2.0.0 
  | | | +-- kind-of@3.0.4 
  | | | | `-- is-buffer@1.1.4 
  | | | +-- normalize-path@2.0.1 
  | | | +-- object.omit@2.0.0 
  | | | | +-- for-own@0.1.4 
  | | | | | `-- for-in@0.1.5 
  | | | | `-- is-extendable@0.1.1 
  | | | +-- parse-glob@3.0.4 
  | | | | +-- glob-base@0.3.0 
  | | | | | `-- glob-parent@2.0.0 
  | | | | `-- is-dotfile@1.0.2 
  | | | `-- regex-cache@0.4.3 
  | | |   +-- is-equal-shallow@0.1.3 
  | | |   `-- is-primitive@2.0.0 
  | | `-- resolve-dir@0.1.1 
  | |   `-- global-modules@0.2.3 
  | |     +-- global-prefix@0.1.4 
  | |     | +-- ini@1.3.4 
  | |     | +-- osenv@0.1.3 
  | |     | | `-- os-tmpdir@1.0.1 
  | |     | `-- which@1.2.10 
  | |     |   `-- isexe@1.1.2 
  | |     `-- is-windows@0.2.0 
  | +-- fined@1.0.1 
  | | +-- expand-tilde@1.2.2 
  | | +-- lodash.assignwith@4.1.0 
  | | +-- lodash.isarray@4.0.0 
  | | +-- lodash.isempty@4.3.1 
  | | +-- lodash.pick@4.3.0 
  | | `-- parse-filepath@1.0.1 
  | |   +-- is-absolute@0.2.5 
  | |   | +-- is-relative@0.2.1 
  | |   | | `-- is-unc-path@0.1.1 
  | |   | |   `-- unc-path-regex@0.1.2 
  | |   | `-- is-windows@0.1.1 
  | |   +-- map-cache@0.2.2 
  | |   `-- path-root@0.1.1 
  | |     `-- path-root-regex@0.1.2 
  | +-- flagged-respawn@0.3.2 
  | +-- lodash.isplainobject@4.0.5 
  | +-- lodash.isstring@4.0.1 
  | +-- lodash.mapvalues@4.5.1 
  | +-- rechoir@0.6.2 
  | `-- resolve@1.1.7 
  +-- minimist@1.2.0 
  +-- orchestrator@0.3.7 
  | +-- end-of-stream@0.1.5 
  | | `-- once@1.3.3 
  | |   `-- wrappy@1.0.2 
  | +-- sequencify@0.0.7 
  | `-- stream-consume@0.1.0 
  +-- pretty-hrtime@1.0.2 
  +-- semver@4.3.6 
  +-- tildify@1.2.0 
  | `-- os-homedir@1.0.1 
  +-- v8flags@2.0.11 
  | `-- user-home@1.1.1 
  `-- vinyl-fs@0.3.14 
    +-- defaults@1.0.3 
    +-- glob-stream@3.1.18 
    | +-- glob@4.5.3 
    | | `-- inflight@1.0.5 
    | +-- glob2base@0.0.12 
    | | `-- find-index@0.1.1 
    | +-- minimatch@2.0.10 
    | | `-- brace-expansion@1.1.6 
    | |   +-- balanced-match@0.4.2 
    | |   `-- concat-map@0.0.1 
    | +-- ordered-read-streams@0.1.0 
    | +-- through2@0.6.5 
    | | `-- readable-stream@1.0.34 
    | `-- unique-stream@1.0.0 
    +-- glob-watcher@0.0.6 
    | `-- gaze@0.5.2 
    |   `-- globule@0.1.0 
    |     +-- glob@3.1.21 
    |     | +-- graceful-fs@1.2.3 
    |     | `-- inherits@1.0.2 
    |     +-- lodash@1.0.2 
    |     `-- minimatch@0.2.14 
    |       +-- lru-cache@2.7.3 
    |       `-- sigmund@1.0.1 
    +-- graceful-fs@3.0.8 
    +-- mkdirp@0.5.1 
    | `-- minimist@0.0.8 
    +-- strip-bom@1.0.0 
    | +-- first-chunk-stream@1.0.0 
    | `-- is-utf8@0.2.1 
    +-- through2@0.6.5 
    | `-- readable-stream@1.0.34 
    |   `-- isarray@0.0.1 
    `-- vinyl@0.4.6 
      `-- clone@0.2.0 

Then, I try to run gulp again and get the same error:

PS D:\home\site\wwwroot> gulp
[01:49:48] Local gulp not found in D:\home\site\wwwroot
[01:49:48] Try running: npm install gulp

I then run npm install gulp

and the output after running gulp

module.js:327
    throw err;
    ^

Error: Cannot find module 'browser-sync'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (D:\home\site\wwwroot\gulpfile.js:3:19)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)

I've been running into this a lot with npm install in the kudu environment, where i'll run npm install and it's always a partial install and i'll have to continue down the list of required modules in say, app.js (when i try to run npm start), or the gulp file and manually install them until all the required modules are satisfied.. any idea why that happens?

davidebbo commented 8 years ago

This looks related to #1573

jvano commented 6 months ago

Hi

If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure: https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request

This way we can better track and assist you on this case

Thanks,

Joaquin Vano Azure App Service