Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPM error "ENOENT: no such file or directory" with source:build:frontend-assets #3118

Closed
geerlingguy opened this issue Sep 20, 2018 · 1 comment

Comments

@geerlingguy
Copy link
Contributor

My system information:

  • Operating system type: macOS
  • Operating system version: 10.13
  • BLT version: 9.2.0-alpha3

Output of blt doctor:

vagrant@local:/var/www/ptl$ blt doctor
+---------------------------+----------------------------------------------------+
| Property                  | Value                                              |
+---------------------------+----------------------------------------------------+
| %paths.%root              | /var/www/ptl/docroot                               |
| %paths.%site              | sites/default                                      |
| %paths.%modules           | sites/all/modules                                  |
| %paths.%themes            | sites/all/themes                                   |
| %paths.%config-sync       | /var/www/ptl/config/default                        |
| %paths.%files             | sites/default/files                                |
| %paths.%temp              | /tmp                                               |
| %paths.%private           | /var/www/ptl/files-private                         |
| admin-theme               | seven                                              |
| alias-searchpaths.0       | /var/www/ptl/drush/sites                           |
| blt-version               | 9.2.0-alpha3                                       |
| bootstrap                 | Successful                                         |
| composer-version          | Composer version 1.7.2 2018-08-16 16:57:12         |
| config-sync               | /var/www/ptl/config/default                        |
| db-driver                 | mysql                                              |
| db-hostname               | localhost                                          |
| db-name                   | drupal                                             |
| db-password               | drupal                                             |
| db-port                   | 3306                                               |
| db-status                 | Connected                                          |
| db-username               | drupal                                             |
| drupal-settings-file      | sites/default/settings.php                         |
| drupal-version            | 8.6.1                                              |
| drush-alias-files.0       | /var/www/ptl/drush/sites/ptl.site.yml              |
| drush-cache-directory     | /home/vagrant/.drush/cache                         |
| drush-conf.0              | /var/www/ptl/vendor/drush/drush/drush.yml          |
| drush-conf.1              | /var/www/ptl/drush/drush.yml                       |
| drush-conf.2              | /var/www/ptl/docroot/sites/default/local.drush.yml |
| drush-script              | /var/www/ptl/vendor/bin/drush                      |
| drush-temp                | /tmp                                               |
| drush-version             | 9.4.0                                              |
| files                     | sites/default/files                                |
| install-profile           | standard                                           |
| modules                   | sites/all/modules                                  |
| php-bin                   | /usr/bin/php7.1                                    |
| php-conf.0                | /etc/php/7.1/cli/php.ini                           |
| php-os                    | Linux                                              |
| private                   | /var/www/ptl/files-private                         |
| root                      | /var/www/ptl/docroot                               |
| site                      | sites/default                                      |
| stacks.drupal-vm.inited   | true                                               |
| stacks.dev-desktop.inited | false                                              |
| temp                      | /tmp                                               |
| theme                     | ptl_theme                                          |
| themes                    | sites/all/themes                                   |
| uri                       | http://local.ptl.com                               |
+---------------------------+----------------------------------------------------+
+--------------------------------------+--------------------------------------------------------------+
| Check                                | Problem                                                      |
+--------------------------------------+--------------------------------------------------------------+
| ConfigCheck:checkGitConfig           | Git repositories are not defined in blt.yml.                 |
|                                      |   Add values for git.remotes to blt.yml to enabled automated |
|                                      | deployment.                                                  |
| NodeCheck:checkNodeVersionFileExists | Neither .nvmrc nor .node-version file found in repo root.    |
+--------------------------------------+--------------------------------------------------------------+

When I run this command:

vagrant@local:/var/www/ptl$ blt source:build:frontend-assets

I get the following output:

Executing frontend-assets target hook...
[ExecStack] npm run build
[ExecStack] Running npm run build in /var/www/ptl/docroot/sites/all/themes/custom/ptl_theme.
npm ERR! Linux 4.4.0-131-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
npm ERR! node v6.14.4
npm ERR! npm  v3.10.10
npm ERR! path /var/www/ptl/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/var/www/ptl/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/var/www/ptl/package.json'
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!     /var/www/ptl/npm-debug.log
[ExecStack]  Exit code 254  Time 0.975s
[error]  Executing target-hook frontend-assets failed. 

And I expected this to happen:

It should run the npm run build command as it would run inside the theme directory.

It looks like it's running that command inside the project root directory for some reason?

@geerlingguy
Copy link
Contributor Author

geerlingguy commented Sep 20, 2018

Ah, just realized—the doc examples are using D7-style paths for the theme. I'm going to file a PR to update the docs so copy-paste doesn't trip up anyone else :)

mikemadison13 pushed a commit that referenced this issue Dec 14, 2018
* Test against Drupal 8.6.x-dev. (#2937)

* Updating versions of Drupal core and Lightning. (#3061)

* Updating CHANGELOG.md and setting version for 9.2.0-alpha1.

* Fixes #3055: Update memcache settings to match changes in Drupal memcache module. (#3058) (#3067)

* Require drupa/memcache equal or greater than 2.0-alpha7.
* Updating memcache settings based on change in drupal/memcache module.

* Allow PHPUnit to bootstrap from core. (#3071)

* Clarified Git hook documentation. (#3073)

* Finished updating memcache config for alpha7. (#3076)

* Finished updating memcache config for alpha7.
* Locking drupal/memcache to 2.0-alpha7 until memcache stabilizes.

* Updating CHANGELOG.md and setting version for 9.2.0-alpha2.

* Travis CI Memcache Service and Settings (#3082)

* Start memcached service and add php extension.
* Check status of memcached service.
* Use blt memcache config on CI.

* Run simplesaml config command on all composer calls. (#3051)

* Update local-development.md (#3087)

Correcting links to PHPStorm documentation on Acquia's documentation service.

* Remove memcache.yml and references to it. (#3093) (#3094)

* Cherry-pick in lost/abandoned commits from 9.x (#3072)

* VM setup tips (#3036)

* Update local-development.md to reference committing DrupalVM files.

* New guidelines for contribution. (#3045)

* Adding replication and verification step sections and clean up formatting.

* Adding new guidelines for PRs to the CONTRIBUTING docs.

* Fixes #2964: When manually deploying using a tag also push that tag to source repo. (#2992)

* Adding a cutSourceTag method and invoking when deploying tag.

* Set default deploy.tag_source config setting and check it when deploying.

* Refactoring to use a single cutTag method.

* Remove line about expectation you already have a tag on your source before you tag a release.

* Warn if user is creating a tag but tag_source option is false.

* Updating deploy documentation.

* Fixes #3053: Update requirement to drush/drush:^9.4.0. (#3078)

* Fixes #3065: Use webflo/drupal-core-require-dev instead of tracking core dev dependencies. (#3068)

* Use core's PHPUnit bootstrap file. (#3092)

* amotic -> atomic (#3098)

Fixed minor typo in code review docs.

* Support memcache on ACSF via flags. (#3096)

* Remove support for PHPUnit 5. (#3102)

* Run validation without interaction on CI. (#3070) (#3097)

* Fixes #3046: Cleaned up Pipelines docs. (#3104)

* Exclude the 'sites/settings' dir for the default list of sites. (#2994) (#3105)

Force-approving this based on the same code's approval on the 9.x branch.

* Updating CHANGELOG.md and setting version for 9.2.0-alpha3.

* Update config_split.config_split.ci.yml (#3129)

* Update README.md (#3113)

* Minor variable / comment refactor. (#3111)

* Fix the link of Memcache documentation page. (#3135)

* Remove PHP 5.6 from the list of tested versions. (#3137)

* Fixes #2945 by removing cloud hook exception for ACSF. (#2946)

* Fixes #2945: removing exception for cloud hooks on ACSF.
* Cleaning up variable use in db scrub hook.
* Adding ACSF check to post deploy and makes db scrub consistent with others.

* updating blt docs to cover ACSF memcache use. (#3136)

* Fix INSTALL.md installation directions for Drush Launcher. (#3127)

* Fixes #3118: Update theme path to more standardized D8 defaults. (#3119)

* Resolves #3106: Add 'skip_permissions_hardening' setting to local settings file template (#3107)

* Update support policies (#3147)

* Update support policies

* Update README.md

* Fix PHP syntax error in acquia simplesamlphp config. (#3141)

* 3149: Minor grammar fix (#3150)

* Fixed travis output. (#3151)

* Travis shouldn't duplicate Drupal 8.6 tests (#3152)

* Travis should test Drupal 8.7.

* Disable 8.7 tests.

* Updating CHANGELOG.md and setting version for 9.2.0.

* Prevent cache collisions in multisite db-update tasks (#3166)

* Add drush cache dir utility script.

* Enhanced Factory Hook to isolate db-update tasks to tempoary drush cache.

* Update Factory Hooks from BLT template.

* Remove redundant cache clear and rebuild to preserve drush context of current request.

* Style tweaks and setting update version number to 9.2.

* Prevent cache collisions in multisite install tasks (#3171)

* Refactor post-install hook to use temp cache dir per site, use requests instead of ENV.

* Refresh Factory Hooks from template for 9002001.

* Update version number for hook.

* Remove redundant factory hook update.

* Removed unused use statements.

* Style and phpcs updates.

* Update BLT settings for site and http/proxy detection (#3172)

* Fix auto detection of sites dir due to core changes.

* Update proxy and host detection for core updates and Acquia VCL changes.

* PHPCS fixes.

* Update deploy.md with correct Cloud Hooks links. (#3188)

The Acquia docs link pointed to a stale page and the BLT one pointed to the 8.x branch, both throwing 404's. I've updated both to point to the latest iterations of each page.

* Update to Drupal Coder 8.3.x. (#3132)

Fixes #2289 
--------

Changes proposed:
---------
(What are you proposing we change?)

- Update composer contraint on Drupal Coder newest release (8.3.1 as of this date)
- Update composer constraint on squizlabs/php_codesniffer to 3.0.1 (matching Coder)
- Remove the use of a bootstrap file with PHPCS. File paths that are not allowed by filesets won't be sniffed by default.
- Add a tests:phpcs:sniff:modified command to sniff unstaged modified or added files in repo for convenience.

* Updating CHANGELOG.md and setting version for 9.2.1.

* Merge tag '9.1.7' of github.com:acquia/blt

* PHP CS fixes.

* Restrict lightning version constraint to 8.5x.

* Revert coder to older version.

* Revert required and suggested composer merge plugin config.

* Update RoboFile.php

* Fix default drush local multisite alias bug causing test failures.

* Fix multisite test alias bug.

* Revert "Update to Drupal Coder 8.3.x. (#3132)"

fccd0d0

* Update hooks and phpcs config.

* BLT Backport of 9.2 to 9x (#3280)

* Fix comment formatting in PhpUnitCommand. (#3211)

* Fixes #3063 by updating faq and install docs to improve install profile instructions. (#3064)

* [9.2.x] Fix undefined trusted_reverse_proxy_ips #3214 (#3215)

Fixes #3214 
--------

Changes proposed:
---------
(What are you proposing we change?)

- check if trusted_reverse_proxy_ips is defined as an array
- if not, set an empty array

Steps to replicate the issue:
----------
(If this PR is not fixing a defect/bug, you can remove this section.)

1. blt setup
2. bootstrap drupal

Steps to verify the solution:
-----------
(How does someone verify that this does what you think does?)

1. apply the patch
2. blt setup / bootstrap Drupal
3. check to ensure following warning does not appear:

```
Warning: in_array() expects parameter 2 to be array, null given in require() (line 27 of /app/vendor/acquia/blt/settings/blt.settings.php).
require('/app/vendor/acquia/blt/settings/blt.settings.php') (Line: 806)
require('/app/docroot/sites/naswa_main/settings.php') (Line: 125)
Drupal\Core\Site\Settings::initialize('/app/docroot', 'sites/naswa_main', Object) (Line: 1056)
Drupal\Core\DrupalKernel->initializeSettings(Object) (Line: 655)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
```

* Fixes #3185 to bring install and local docs inline. (#3186)

* Fixing updates 9002000 message. (#3205)

* Fixing missing semi-colon at end of line. (#3208)

* Fixes #3243 to clean up dry-run in deploy command. (#3263)

* Multisite bugfixes (#3231)

* Fix multisite test alias bug.

* Fix default drush local multisite alias bug causing test failures.

* Fix global varible scope and phpcs syntax.

* Update variable names and fix phpcs validation errors..

* Add missing phpunit-bridge package.

* Add BLT update hook for 9.1.9 release.

* Update version for 9.1.9 release.

* Revert "Lock core in 9.x branch to 8.5.6. (#3062)"

b2e0bcf

* Use assertions to resolve build failures due to phpunit 'risky tests' notice.

* Revert travis backports to debug build.

* Ensure minimum of dmore/chrome-mink-driver 2.5.0.

* Remove duplicate update hook.

* Removing changes from composer files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant