Semantic-ui: npm install with autoInstall:true in semantic.json does not copy or build dist files

Created on 15 Aug 2016  路  9Comments  路  Source: Semantic-Org/Semantic-UI

If you have a semantic.json file with autoInstall:true - npm install will just install the semantic-ui files in node_modules, and not complete copying the files out to semantic/ and run gulp build as a manual install would.

Created fix: https://github.com/Semantic-Org/Semantic-UI/pull/4430

I closed the PR for now to do more testing with other semantic.json options.

Most helpful comment

+1 ... please merge this!

All 9 comments

Reopened PR - added 'build' option in semantic.json to control whether to gulp build immediately after autoinstall.

Please... merge and push it straight away.... this is definitely broke!~

+1 ... please merge this!

+1 This is what I expected to happen with the autoInstall option present

It's sad to see this issue is still open 馃憥

It seems to work for me using the following semantic.json (notice the lack of version - intended):

{
  "base": "semantic\\",
  "paths": {
    "source": {
      "config": "src/theme.config",
      "definitions": "src/definitions/",
      "site": "src/site/",
      "themes": "src/themes/"
    },
    "output": {
      "packaged": "dist/",
      "uncompressed": "dist/components/",
      "compressed": "dist/components/",
      "themes": "dist/themes/"
    },
    "clean": "dist/"
  },
  "permission": false,
  "autoInstall": true,
  "rtl": false
}

.gitignore

# dependencies
/node_modules
/bower_components
semantic/gulpfile.js
semantic/src
semantic/tasks
semantic/dist/*
!semantic/dist/*.min.js
!semantic/dist/*.min.css

Make sure to keep semantic/src/theme.config in source control and also the folder at semantic/src/definitions by adding a .gitkeep file to it.

When installing after npm install it will remove the semantic/src/definitions/.gitkeep file and add version to semantic.json - make sure to discard those changes. It would be better if it left things untouched, but it only installs Semantic after cloning repo or updating Semantic - running gulp build leaves those files alone and produces the desired output in dist/.

Please fix this... it's broken on our DeployBot setup due to being unable to install via autoInstall

The PR #4430 has been merged, if anyone still has this problem please make sure you're using a version of Semantic UI higher than 2.2.9.

Still having this issue deploying on Netlify. I'm trying to deploy a Storybook instance and the Gulp postinstall keeps breaking the deploy, despite changing the autoInstall parameter in the semantic.json to true.

Here's my build command:

Build command:
npm i && build-storybook -c .storybook -o .out

Publish directory:
.out/

Receive this error on deploy:

12:05:00 PM: Installing NPM modules using NPM version 6.9.0
12:05:33 PM: > [email protected] postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
12:05:33 PM: > node scripts/postinstall || echo "ignore"
12:05:33 PM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
12:05:33 PM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
12:05:33 PM: > https://opencollective.com/core-js 
12:05:33 PM: > https://www.patreon.com/zloirock 
12:05:33 PM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
12:05:33 PM: > [email protected] postinstall /opt/build/repo/node_modules/core-js
12:05:33 PM: > node scripts/postinstall || echo "ignore"
12:05:33 PM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
12:05:33 PM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
12:05:33 PM: > https://opencollective.com/core-js 
12:05:33 PM: > https://www.patreon.com/zloirock 
12:05:33 PM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
12:05:33 PM: > [email protected] postinstall /opt/build/repo/node_modules/core-js-pure
12:05:33 PM: > node scripts/postinstall || echo "ignore"
12:05:33 PM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
12:05:33 PM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
12:05:33 PM: > https://opencollective.com/core-js 
12:05:33 PM: > https://www.patreon.com/zloirock 
12:05:33 PM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
12:05:33 PM: > [email protected] postinstall /opt/build/repo/node_modules/gatsby-plugin-mdx/node_modules/core-js
12:05:33 PM: > node scripts/postinstall || echo "ignore"
12:05:33 PM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
12:05:33 PM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
12:05:33 PM: > https://opencollective.com/core-js 
12:05:33 PM: > https://www.patreon.com/zloirock 
12:05:33 PM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
12:05:33 PM: > [email protected] postinstall /opt/build/repo/node_modules/preact
12:05:33 PM: > node -e "console.log('\u001b[35m\u001b[1mLove Preact? You can now donate to our open collective:\u001b[22m\u001b[39m\n > \u001b[34mhttps://opencollective.com/preact/donate\u001b[0m')"
12:05:34 PM: Love Preact? You can now donate to our open collective:
12:05:34 PM:  > https://opencollective.com/preact/donate
12:05:34 PM: > [email protected] install /opt/build/repo
12:05:34 PM: > gulp install
12:05:34 PM: gulp[1366]: ../src/node_contextify.cc:635:static void node::contextify::ContextifyScript::New(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `args[1]->IsString()' failed.
12:05:34 PM:  1: 0x8fa0c0 node::Abort() [gulp]
12:05:34 PM:  2: 0x8fa195  [gulp]
12:05:34 PM:  3: 0x92e5be node::contextify::ContextifyScript::New(v8::FunctionCallbackInfo<v8::Value> const&) [gulp]
12:05:34 PM:  4: 0xb8d2db  [gulp]
12:05:34 PM:  5: 0xb8f272 v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [gulp]
12:05:34 PM:  6: 0x289b3ce5be1d
12:05:34 PM: Aborted (core dumped)
12:05:34 PM: npm ERR!
12:05:34 PM: code
12:05:34 PM:  ELIFECYCLE
12:05:34 PM: npm ERR! errno
12:05:34 PM:  134
12:05:34 PM: npm ERR! [email protected] install: `gulp install`
12:05:34 PM: npm
12:05:34 PM:  ERR! Exit status 134
12:05:34 PM: npm
12:05:34 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
12:05:34 PM: ERR!
12:05:34 PM: npm ERR!
12:05:34 PM:  Failed at the [email protected] install script.
12:05:34 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
12:05:34 PM: npm
12:05:34 PM:  ERR! A complete log of this run can be found in:
12:05:34 PM: npm ERR!     /opt/buildhome/.npm/_logs/2019-09-06T19_05_34_667Z-debug.log
12:05:34 PM: Error during NPM install
12:05:34 PM: Error running command: Build script returned non-zero exit code: 1
12:05:34 PM: Failing build: Failed to build site
12:05:34 PM: Finished processing build request in 55.119275823s

With this semantic.json config:

{
  "base": "",
  "paths": {
    "source": {
      "config": "src/theme.config",
      "definitions": "src/definitions/",
      "site": "src/site/",
      "themes": "src/themes/"
    },
    "output": {
      "packaged": "dist/",
      "uncompressed": "dist/components/",
      "compressed": "dist/components/",
      "themes": "dist/themes/"
    },
    "clean": "dist/"
  },
  "permission": false,
  "autoInstall": true,
  "rtl": false,
  "version": "2.4.2"
}

And here's my .gitignore:

node_modules/
test/coverage/
coverage/
src/**/site/
tasks/**/oauth.js

# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.zip
*.vi
*~
*.sass-cache
*.ruby-version

# OS or Editor folders
.DS_Store
._*
Thumbs.db
.cache
.project
.settings
.tmproj
.docpad.db
*.esproj
nbproject
*.sublime-project
*.sublime-workspace
.build*
.idea
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sarbona picture sarbona  路  3Comments

guilhermeblanco picture guilhermeblanco  路  3Comments

Morrolan picture Morrolan  路  3Comments

batata004 picture batata004  路  3Comments

rdzidziguri picture rdzidziguri  路  3Comments