Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

"typings install" as "npm run postinstall" misses global dependencies #623

Open
GreenToast opened this issue Jul 5, 2016 · 11 comments
Open

Comments

@GreenToast
Copy link

My package.json looks contains the typings install
"scripts": { "postinstall": "typings install",

but it's working different when I run npm run postinstall only main and broswer dependecies are installed, but when running typings install direct from the command line it install also the globals.

Neither installing typings as local dependency or adding --global helped.

@blakeembrey
Copy link
Member

What is your version of Typings? What does your typings.json say? It's most likely a version mismatch.

@kutynko
Copy link

kutynko commented Aug 3, 2016

Having same issue. Described it on SO. http://stackoverflow.com/questions/38699254/install-global-typings-from-npm-script
my typings version =1.3.2, npm version =3.3.12
typings.json content:

{
  "name": "???",
  "version": false,
  "globalDependencies": {
    "angular": "github:DefinitelyTyped/DefinitelyTyped/angularjs/angular.d.ts#f3911d711006be676d9e1bcbc7c768b39d1ad81b",
    "angular-ui-router": "registry:dt/angular-ui-router#1.1.5+20160707113237",
    "ui-grid": "registry:dt/ui-grid#0.0.0+20160619032954"
  },
  "dependencies": {
    "lodash": "registry:npm/lodash#4.0.0+20160723033700"
  }
}

@kutynko
Copy link

kutynko commented Aug 3, 2016

Turned out to be version mismatch between local and global typings instance.

@Izhaki
Copy link

Izhaki commented Aug 3, 2016

I'm having the same problem.

Basically, when the postinstall script runs on my local machine (which has typings installed both globally and locally) - it works fine. But I also have the repository on a docker container running on DigitalOcean where I've only installed typings locally - it doesn't install globalDependencies for some reason.

Must typings be installed globally?

@unional
Copy link
Member

unional commented Aug 3, 2016

Nope. If you use postinstall, it will lookup and use the typings locally. Can you confirm your local typings on your docker is up to date?

If it is, then share your cmd and result.

@Izhaki
Copy link

Izhaki commented Aug 3, 2016

From https://github.com/Izhaki/gefri:

"typings": "^1.3.1",

Doesn't run properly using this Dockerfile:

FROM node:4
ENV SHELL=/bin/bash
EXPOSE 8080

@unional
Copy link
Member

unional commented Aug 3, 2016

You don't have a typings.json? Or it's about something else?

@Izhaki
Copy link

Izhaki commented Aug 3, 2016

Odd...

Somehow it made it to .gitignore, but it does exist within the docker image:

{
  "globalDependencies": {
    "jasmine": "registry:dt/jasmine#2.2.0+20160621224255"
  }
}

@Izhaki
Copy link

Izhaki commented Aug 3, 2016

Sorry, my wrong, it is created in postinstall:

"postinstall": "typings install dt~jasmine --save --global && mkdir -p dist",

@unional
Copy link
Member

unional commented Aug 3, 2016

In postinstall (and pefered prepublish), you probably want to do just typings install and keep the typings.json in your repo.

@Izhaki
Copy link

Izhaki commented Aug 10, 2016

I had to take the droplet down. So no way to check at the moment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants